W3C home > Mailing lists > Public > www-style@w3.org > March 2007

Re: [CSS21] Make XHTML <body> magic just like HTML <body>

From: L. David Baron <dbaron@dbaron.org>
Date: Thu, 8 Mar 2007 18:53:41 -0800
To: Ian Hickson <ian@hixie.ch>
Cc: ivan <pivo@pobox.sk>, Steven Pemberton <steven.pemberton@cwi.nl>, Simon Pieters <zcorpan@gmail.com>, "Patrick H. Lauke" <redux@splintered.co.uk>, www-style@w3.org
Message-ID: <20070309025341.GA11294@ridley.dbaron.org>
> On Fri, 9 Mar 2007, ivan wrote:
> > On Fri, Mar 09, 2007 at 12:08:47AM +0000, Ian Hickson wrote:
> > ...
> > >    14.2 paragraph 4: change to:
> > > 
> > >       For HTML documents, however, we recommend that authors specify the
> > >       background for the BODY element rather than the HTML element.
> > ...
> > 
> > Why recommend? Which browser doesn't allow html selector yet? I'd say deprecate.

Because there's an installed base of style sheets on the Web that
use body for this purpose, and the cascading rules don't interact
particularly well with the rule about HTML and BODY if some style
sheets use HTML and some use BODY.

In other words, if HTML and BODY are mixed, e.g., between user and
author style sheets or between site-wide style sheets and
page-specific style sheets, you'll end up with a margin around the
page getting the background from HTML and the body of the page
getting the color from BODY, instead of whichever one is higher in
the cascade winning.

So now that there's an installed base using BODY, it's better to
stick to it.


L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Received on Friday, 9 March 2007 02:54:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:28 UTC