W3C home > Mailing lists > Public > www-style@w3.org > February 2000

Re: line-height: <number>

From: Erik van der Poel <erik@netscape.com>
Date: Thu, 03 Feb 2000 21:33:56 -0800
Message-ID: <389A64C4.664EB9CC@netscape.com>
To: www-style <www-style@w3.org>
Ian Hickson wrote:
> 
> Erik van der Poel wrote:
> >
> > The spec says:
> >
> >#   The 'em' unit is equal to the computed value of the
> >#   'font-size' property of the element on which it is used.

What does this mean? What is "the element on which it is used"? The
child element in case of inheritance? Or the parent?

> No, it is always the computed value for 'line-height' that is
> inherited, except if line-height is specified as a unit-less <number>.
> 
> Section 6.2:
> # Specified percentage values are not inherited; computed values are.

Section 6.2 gives a totally different example. There, the *font-size* is
set to 120%. That means 120% of the *parent's font-size*. So, if the
*specified* value (120%) was inherited, the font would get bigger and
bigger as you nest elements. Undesirable.

However, in the case of *line-height*, 120% is relative to the
*font-size*, not the parent's line-height. So, in the line-height case,
it doesn't get bigger and bigger as you nest elements. So it is not
necessary to inherit the computed value. The specified value will do.

Also, it doesn't make sense to apply 120% to some other element's
font-size. That could easily lead to overlapping lines of text. So you
say that people shouldn't use percentages for line-height, but then why
even bother to allow percentages for line-height at all?

It seems very illogical to me.

> > I think that percentages should be treated the same way as numbers.
> 
> If they were, then there would be no difference between numbers and
> percentages.

Why should there be a difference between numbers and percentages?
Wouldn't it just be confusing for them to mean different things,
depending on inheritance?

Erik
Received on Friday, 4 February 2000 00:36:16 GMT

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