|
Posted by Toby Inkster on 09/25/06 07:42
dorayme wrote:
> There is a left out unit in
>
> div#testSheets p{
> line-height:2;
> }
This is not an error. "line-height" is one of the few numeric values in
CSS that *does not require a unit*.
A unit *can* be specified, but when the unit is not specified, the
property takes a special meaning -- it initially means the same as if it
were specified in "ems" *except* that if any child elements have different
font sizes, the line height will scale up and down with the font size.
If you explicitly say "line-height: 2em" you get a different behaviour --
the line height remains constant, even when child elements have a larger
or smaller font.
Line heights without units are usually the most useful.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|