

Re: line height vs. margins

From: Chris Lilley <Chris.Lilley@sophia.inria.fr>
Date: Sat, 2 Aug 1997 02:44:36 +0200 (MET)
Message-Id: <9708020244.ZM3710@grommit.inria.fr>
To: Sho Kuwamoto <skuwamoto@macromedia.com>, www-style@w3.org
On Aug 1,  5:45pm, Sho Kuwamoto wrote:

> Is there any consensus on where the extra space from line-height
> should be rendered?

Yes. The concensus was formed by the HTML ERB in 1996 and is
contained in the CSS1 specification.

> Let's say I have some text which paginates as follows.
> Let x be the space between paragraphs, and y be the space
> between lines.

> We can safely assume that y' = y + 10px, but what about x' and x''?

x' = x' + 5px
x'' = x'' + 5px

> Netscape seems to stick all the whitespace above the text, so that
> x' = x+10px, and x'' = x.

That is incorrect behaviour.

> Microsoft IE seems to do something
> different, but I can't tell what it is. Perhaps x'=x+5px and x"=x+5px?

If so, that is correct behaviour.

> What *should* it do? On the one hand, we could leave it up to
> the UA, but if the point of CSS is to allow the web author to
> specify layout accurately, it seems that this would be a good
> thing to nail down.

Yes. It is nailed down at

  4.4    The height of lines

  All elements have a 'line-height' property that, in principle, gives
  the total height of a line of text. Space is added above and below
  the text of the line to arrive at that line height. For example, if the
  text is 12pt high and 'line-height' is set to '14pt', an extra space of
  2pt is added, namely 1pt above and 1pt below the line. Empty
  elements influence these calculations just like elements with

The spec goes on to give more details.

Are you implementing a renderer?

Graphics and Fonts Guy            The World Wide Web Consortium
chris@w3.org                       2004 Rt des Lucioles / BP 93
Received on Friday, 1 August 1997 20:44:42 GMT
