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@[]>
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 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:44 UTC