| Previous · Next | |
| User | Message |
|
elnino
|
Date: 2/12/2010 9:27 pm · Subject: multiple selectors · Rating: 0
If your div has multiple classes, how does one designate that in the css file? <div class="wg-second-column wg-right"> vs <div class="wg-second-column wg-left"> I would like to make a distinction between teh two divs above. But I guess if I have to make *another* unique class, I will, but it would be nice to take advantage of the combination of existing classes. Thanks |
| Back to Top |
Rate [ | ]
|
|
dionak
|
Date: 2/13/2010 0:03 am · Subject: Re: multiple selectors · Rating: 0
If you want to target a div that has both classes defined, you use double dot syntax. E.g. - .wg-second-column.wg-right (no spaces) If you define this after the other class declarations, you'll inherit the previously defined CSS values. Does this answer your question or did you have additional concerns? Diona |
| Back to Top |
Rate [ | ]
|
|
elnino
|
Date: 2/13/2010 8:19 am · Subject: Re: multiple selectors · Rating: 0
Cool!! I couldn't find that google, what is that technique "called" so am able to google that again? Thansk dionak! |
| Back to Top |
Rate [ | ]
|
|
rogier
|
Date: 2/13/2010 10:42 am · Subject: Re: multiple selectors · Rating: 0
Multiple classes are very useful, however there is one problem: IE6 and lower doesn't understand this syntax (.classone.classtwo); it will only apply the last class (details). You can still use it safely if you split up the statements, like we did in the layout.css stylesheet. This article explains it well using a simple menu example and offers a IE6/IE5 workaround too: http://www.maxdesign.com.au/articles/multiple-classes/ Rogier | United Knowledge |
| Back to Top |
Rate [ | ]
|