Re: missing background-color

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