W3C home > Mailing lists > Public > www-validator-css@w3.org > November 2005

Re: missing background-color

From: Ian Hickson <ian@hixie.ch>
Date: Sun, 13 Nov 2005 18:09:18 +0000 (UTC)
To: "Jukka K. Korpela" <jkorpela@cs.tut.fi>
Cc: www-validator-css@w3.org
Message-ID: <Pine.LNX.4.62.0511131805100.9929@dhalsim.dreamhost.com>

On Sun, 13 Nov 2005, Jukka K. Korpela wrote:
> Besides, inherit is the initial value. Anyway, the element would inherit 
> its background color from its parent element, and you cannot know which 
> color that is.

The initial value of 'background-color' is 'transparent', not 'inherit'.

Elements don't inherit any background color. The problem is that an 
element with a color set and not a background color set can have a color 
and background color set from a user stylesheet, where the end result has 
the element's color coming from the author stylesheet and the background 
color coming from the user stylesheet, and since those colors were picked 
by different people they might be the same and make the text go invisible.

The solution is to set 'background: transparent' whenever setting 'color', 
if you have colors set all the way back to the root element (explicitly as 
'background: transparent; color: inherit' if you want the default 
behaviour); otherwise, the solution is to set both 'background' and 
'color' to non-transparent, non-inherit values.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 13 November 2005 18:09:30 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:40:41 UTC