Re: Competing classes

Also sprach Braden N. McDaniel:

 > 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 text is blue. Both rules in the stule sheet applies, and cascading
rule #4 says that the latter one wins:

  Finally, sort by order specified: if two rules have the same weight,
  origin and specificity, the latter specified wins. Rules in imported
  style sheets are considered to be before any rules in the style sheet
  itself.

http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order

-h&kon

Håkon Wium Lie                     http://www.opera.com/people/howcome
howcome@opera.com                                gets you there faster

Received on Friday, 13 August 1999 13:57:52 UTC