W3C home > Mailing lists > Public > www-style@w3.org > August 1999

Re: Competing classes

From: Håkon Wium Lie <howcome@opera.com>
Date: Fri, 13 Aug 1999 08:31:36 -0400 (EDT)
Message-Id: <199908131230.OAA25659@stovner.sys.sol.no>
To: "Braden N. McDaniel" <braden@shadow.net>
Cc: <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:00 GMT