On 24 Feb 2011, at 1:30, Philippe Wittenbergh wrote:

> Yes, and that is expected. Read again what the css 2.1 docs tell - basically 
> it says that the background of the <body> element is propagated to the 
> viewport when (and only when) the root element is transparent and has no 
> background-image attached. The wording in the CSS 2.1 chapter is quite a bit 
> unclear, though. The CSS3 backgrounds and borders module is much easier to 
> understand:
> 
> http://www.w3.org/TR/css3-background/#special-backgrounds
> 
> (good test case btw)
> 
> 
>> It appears that the W3C recommends *not* to style the html element 
>> <http://www.w3.org/TR/2009/CR-CSS2-20090423/colors.html#background>.
> 
> I never understood why that recommendation is part of the spec… Older UA 
> didn't allow the styling of the root element (<html>), but there aren't many 
> of those around anymore.
> (some very basic UA's such as those found on some mobile devices still have 
> that limit, but they have so many 'issues' that it is not worth worrying 
> about that.)

Yes, the new wording is clearer. But it still says that:
   « It is recommended that authors of HTML documents specify the canvas 
background for the BODY element rather than the HTML element. »

> No wicked ways there. I've styled the root element (<html>) for ages without 
> problems (color, background, font, etc). Make sure to set foreground color 
> ('color' property) on the same element, though. If you're really worried 
> about older UAs, style the body for them:
> 
> body { background: $value url($image); color: $value; }
> :root { background: $value url($image); color: $value; } /* same as above */
> :root > body { background: transparent; color: inherit; }


Interesting. I suppose you use :root because older UAs won't read it. However, 
in my case I still cater to IE6 and it doesn't understand the child selector >. 
And I'm using Selectivizir, so IE6 will understand the :root element... Maybe 
":root body" would work as well.

However, I'm not worried about "very basic UAs" because I think people using 
those will not care about the color of the background as long as the rest of 
the page is readable.

Anyway, since no one here seems to think badly of not complying to the W3C 
position on styling the html element (the reason for which is not explained in 
the spec), I'll continue doing so with a clear conscience :-).

Thanks,

Ellen
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to