W3C home > Mailing lists > Public > www-style@w3.org > July 2003

Re: [CSS21] body { padding: 8px; } HTML40 sample stylesheet

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Wed, 23 Jul 2003 23:17:50 +0300 (EEST)
To: www-style@w3.org
Message-ID: <Pine.GSO.4.50.0307232303330.15123-100000@korppi.cs.tut.fi>

On Wed, 23 Jul 2003, Chris Moschini wrote:

> In the HTML40 sample stylesheet provided with all versions of CSS so
> far, it says:
>
> body { padding: 8px; line-height: 1.12em }

Actually there are only two versions of CSS defined, and CSS 1
specification has a sample style sheet for HTML 2.0, with

BODY {
  margin: 1em;
  font-family: serif;
  line-height: 1.1;
  background: white;
  color: black;
}

whereas the one in CSS 2 has

BODY            { padding: 8px; line-height: 1.33 }

What you quote is from the CSS 2.1 draft.

Generally, the sample style sheet in the CSS 2 spefication deviates in
several (and partly odd) ways from the one in CSS 1, and there are strange
changes in CSS 2.1. In particular, there's a tendency from using the
logical em unit to using px values. Except for line-height, where CSS 2.1
uses the em unit, which is very strange. (It means that the computed value
is inherited, so the line spacing in inner elements will _not_ be in
proportion to their own font size.) And moving back to a small value like
1.12 is strange too.

On the other hand, the sample style sheets have largely been ignored by
browser vendors. They are mostly just exercises - though they illustrate
some ideas and principles in a useful way. Their semi-normative status
("Developers are encouraged to use it as a default style sheet in their
implementations.") might still cause some trouble - some people might
actually take them seriously when writing or modifying browsers.

Hence, I think the sample style sheet should be removed, if a revised
version of CSS 2 is issued. Well, the other option would be to write the
sample style sheet carefully, after first deciding whether it tries to
describe browser practices or give a recommendation. But this wouldn't be
easy.

> Is this accurate given the CSS box model?

Why not?

> What then are the height and width of the body tag?

When not set, the initial value of auto applies. What _that_ means is a
different thing. But do you think the height or width should be set to
some other values? Why, and to which values?

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Wednesday, 23 July 2003 16:17:53 GMT

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