Name
line-height — NN 4 IE 4 CSS 1
Synopsis
Inherited: Yes
Sets the height of the inline box (the box holding one physical line
of content). Under normal circumstances, the
line-height of the tallest font in a line of text
or the tallest object governs the line height for that content line.
In theory, you should be able to set the
line-height of a block element and have that value
apply to all content lines, regardless of the font
face or font size specified for inline content.
In practice, both Navigator 4 and Internet Explorer 4 can experience
line space rendering problems when the font-size
of inline text is larger than the size of surrounding text. Not all
lines of the outer block adhere to the block’s
line-height setting as expected (especially lines
after the larger text segment). Moreover, in Navigator 4, the
line-height attribute does not traverse more than
one generation if the second generation element becomes a block-level
element (such as a positioned or floated element). Test these
settings extensively to make sure you get the look you desire.
CSS Syntax
line-height: normal |number|length|percentage
JavaScript Equivalent
lineHeight
Value
A value of normal lets the browser calculate line
spacing for the entire element, thus producing a computed value that
can be inherited by nested elements. A
number value (greater than zero) acts as a multiplier for the font-size of the current element. Therefore, if a nested element inherits the line-height multiplier from its parent, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access