line height

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
small.

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&kon

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