|
Posted by Jukka K. Korpela on 09/11/06 06:48
dorayme <doraymeRidThis@optusnet.com.au> scripsit:
> If you are going to use line-height (make sure you need to), use
> em.
No, it is best to use just numbers. The reason is that the line-height
property is rather special. If you declare, say, line-height: 1.5 (there's
seldom a reason for such a large value, but let's pretend there is, like the
original question did), then the _declared value_ 1.5 gets inherited. This
means that if there is an element with a different font size, the
line-height value gets adapted to the font size. If you declare line-height:
1.5em (or 150%), then the _computed value_ gets inherited.
Note: This might look like a non-issue since you don't change the font size.
But you might, in a later version, without remembering to consider the
line-height impact, or someone else who maintains the page next year might
do so. Besides, even browser and user style sheets may change font size.
Actually authors _should_ generally use line-height. The reason is that
browser defaults vary rather unpredictably and are generally too small,
especially for fonts with large x height. Something like
body { line-height: 1.25; }
might be suitable in a typical case. If you think of using Verdana, stop
that, but if you don't, line-height: 1.3 is not too much.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
[Back to original message]
|