CSS Attributes Index Text Attributes
Sets or retrieves the distance between lines in an object.
CSS |
{ line-height: 'normal' | number | length | percentage } |
Script |
object.style.lineHeight = sHeight ] |
normal |
Default height. |
number |
Floating-point number. |
length |
Floating-point number and a valid CSS length unit: either an absolute units designator ( cm, mm, in, pt, pc, or px ) or a relative units designator ( em or ex ). |
percentage |
Value expressed as a percentage of the parent object’s height. |
The property is read/write with a default value of normal; the cascading stylesheet ( CSS ) attribute is inherited.
Line height is the distance between the descender of the font to the top of the internal leading of the font. A negative line height is allowed to achieve various shadowing effects.
If there is more than one object on a formatted line, the maximum line height applies. In this case, negative values are not allowed.
Microsoft® Internet Explorer® 3.0 supports the line-height attribute through the font attribute.
The following example demonstrates the effects of applying user-supplied values with the various length units possible for the CSS line-height attribute. This demo requires Microsoft® Internet Explorer® 4 or later.
Show me
The sample below uses inline event handlers to dynamically control an object’s lineHeight property in response to mouse events.
<p onmouseover="this.style.lineHeight='10mm'"
onmouseout="this.style.lineHeight=''">
...
</p>
Show me
letter-spacing