W3C home > Mailing lists > Public > www-style@w3.org > September 1997

Re: Precedence within a stylesheet

From: Eric A. Meyer <eam3@po.cwru.edu>
Date: Thu, 18 Sep 1997 13:56:57 -0500
Message-Id: <v0310280ab047293ff3ee@[129.22.138.152]>
To: www-style@w3.org
At 12:10 -0500 09/18/97, Andi Hindle wrote:
>I'm trying to figure out what takes precedence over what in a stylesheet.
>Thus, given:
>
>body { color : #FFFFFF;}
>h1 {color : #FF0000;}
>
>will my <h1> turn out red or white?

   If I read Section 3.2 of the specification correctly, your H1s will turn
out red, assuming that both statements have the same origin.  I'm basing
this on rule 4 (the specificity rule).  Since a declaration for H1 is more
specific than a declaration for BODY, it should win out.

--
Eric A. Meyer  -  eam3@po.cwru.edu  -  http://www.cwru.edu/home/eam3.html
 Hypermedia Systems Manager
 Digital Media Services                http://www.cwru.edu/dms/dms.html
 Case Western Reserve University       http://www.cwru.edu/
Received on Thursday, 18 September 1997 13:57:11 GMT

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