W3C home > Mailing lists > Public > www-style@w3.org > June 2006

Re: specificity and user style sheets

From: Stanimir Stamenkov <stanio@myrealbox.com>
Date: Thu, 01 Jun 2006 13:09:51 +0300
Message-ID: <447EBCEF.4040107@myrealbox.com>
To: Jonathan Chetwynd <j.chetwynd@btinternet.com>
CC: www-style@w3.org

/Jonathan Chetwynd/:

> body {background:black; color:white;}
> 
> however whilst there expectation might be that this would provide a 
> universal solution to their reading difficulties, in reality it achieves 
> almost nothing...

You need to use !important declarations:

     body { background: black !important; color: white !important }

For more details you may read the "Cascading" [1] section of the CSS 
specification. The importance order given in ascending order of 
precedence:

    1. user agent declarations
    2. user normal declarations
    3. author normal declarations
    4. author important declarations
    5. user important declarations

[1] http://www.w3.org/TR/CSS21/cascade.html#cascade

-- 
Stanimir
Received on Thursday, 1 June 2006 10:10:18 GMT

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