Re: Competing classes

On Fri, 13 Aug 1999 07:27:10 -0400, "Braden N. McDaniel"
(braden@shadow.net) wrote:
> Surely this case is specified and I just haven't been able to find it...
> 
>   .red { color: red }
>   .blue { color: blue }
> 
>   ...
> 
>   <p class="red blue">What color am I?
> 
> 
> Who wins, and why?

The paragraph is blue, because the ".blue" class was given after the
"red".  (Since both rules match the paragraph and have the same origin,
weight, and specificity, order decides. [1])

This behavior is tested in [2].

David

[1] http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order
[2] http://www.fas.harvard.edu/~dbaron/css/test/twoclass

L. David Baron     Rising Sophomore, Harvard     dbaron@fas.harvard.edu
Links, SatPix, CSS, etc.        < http://www.fas.harvard.edu/~dbaron/ >
Summer Intern, Netscape - however, opinions are entirely my own, etc.

Received on Friday, 13 August 1999 09:28:18 UTC