W3C home > Mailing lists > Public > www-style@w3.org > December 1998

line height

From: Håkon Wium Lie <howcome@w3.org>
Date: Wed, 16 Dec 1998 01:54:01 +0100 (MET)
Message-Id: <199812160054.BAA20427@stovner.sys.sol.no>
To: bill brissette <billb@gbcom.com>
Cc: <www-style@w3.org>
bill brissette wrote

 > i'm working on a large site that uses external sheets to describe font 
 > properties. i am also using an embedded font for some, but not most of 
 > the text. when there is a line of text containing both the default font 
 > and the embedded font, the line height is affected, because the embedded 
 > font is a bit taller than the default. i've tried a few different 
 > approaches, with no luck, to even out the line height.  my desired result 
 > is to have all of the lines in all of the copy to have the line height of 
 > the highest font.  any suggestions out there?  it's giving me a big 
 > headache.  thanks,

It's a little tricky, yes. You need to set the 'line-height' property
of the embedded elmement to be the same or smaller than the parent
element. It's easy to make it smaller (e.g. 0), but when a certain
line only contains the embedded element, the line height will be too

A better approach is to set the 'line-height' of the parent element
(say P) using percentage units, not numnbers:

  P { line-height: 120% }

According to the specification, the the calculated value will then be
inherited -- not the factor. So, child elements of P will have the
same value for 'line-height' as P has.


H   å   k   o   n      W   i   u   m       L   i   e
howcome@w3.org      http://www.w3.org/people/howcome
World     W      i     d     e       Web  Consortium
Received on Tuesday, 15 December 1998 19:54:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:49 UTC