Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
css inheritance, or making a class like another
Old 05-27-2005, 05:37 AM css inheritance, or making a class like another
bez
bez's Avatar
Skilled Talker

Posts: 53
Trades: 0
I have 2 classes in CSS that have different names but all the same rules. To save bandwidth id like to know if i can make one equal the other, something like:

.reservationTable{
.sessionTable
}

(doesnt work)

Even better, can you make one the parent class of the other (so it contains all the same rules but can be extended)?

Copy & pasting big chunks of CSS seems like such a clumsy way of doing this.

Thanks for any feedback
bez is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-27-2005, 06:54 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
.reservationTable, .sessionTable {
definitions
}
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-27-2005, 07:32 AM
bez
bez's Avatar
Skilled Talker

Posts: 53
Trades: 0
thanks chris, that does work. however with some of my longer rules i end up with code like this:

table .reservationTable, .reservationTable td, .reservationTable th, table .sessionTable, .sessionTable td, sessionTable th {
border: 1px solid rgb(133,180,12);
border-collapse: collapse;
}

Not too bad now but if i add more classes and rules it could get very long (for instance 1 more class and one more type of say, 'caption', would result in 6 more combinations). It would be nice if i could just say in css "Make reservationTable = sessionTable in all circumstances" with one line of code. But if you cant do it then thats that i guess.
bez is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to css inheritance, or making a class like another
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14194 seconds with 12 queries