Adam Kuehn wrote:

> Zoe M. Gillenwater wrote:
>
>> >>>Does this accurately describe the div above:
>> >>>about + home {color:black};
>> >>>
>> >>No.  that would be
>> >>.about.home { color: black;}
>> >
>> >Interesting.  Do you know the name for this kind of styling?  I'm going
>> >to test it in various browsers right now.
>>
>> I suppose it's just called multiple class styling.  IE doesn't support
>> it fully.  An easier way to get what you want:
>>
>> .about, .home { color: black; }
>
>
> Actually, that formulation could well break something you don't want 
> broken.  Note that .about.home will break in IE/Win, which will apply 
> the rule to everything with the "home" class, completely ignoring the 
> "about" class.  However, modern browsers will get it correct, and only 
> apply the rule to elements with both classes.  Zoe's method will apply 
> the rule to any element with *either* class in all browsers.  That is 
> probably not what you want.


Right.  But most of the time the simple grouping of selectors will get 
you what you want, as long as you know to work around it elsewhere with 
your other selectors.  My point was not that the selectors I showed did 
the same thing (they don't, as you correctly pointed out), but that they 
can accomplish the same end result for most cases.  They "do the job."

Example:
I have a div with the classes "about" and "home" on it that I want to 
have black text, but another div with only the class "about" on it that 
I want to have red text.  And let's say this "about" div is within a div 
named "sidebar."  I could then accomplish this with these selectors:

.about, .home { color: black; }

#sidebar .about { color: red; }

My point was just that most of the time IE's bug can be worked around by 
using simpler selectors, rather than messing with mulitple class 
selectors and having to fret about their lack of support in IE.

Hope that's clearer to everyone.

Zoe

-- 
Zoe M. Gillenwater
Design Services Manager
UNC Highway Safety Research Center
http://www.hsrc.unc.edu

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to