line-height

Browser Internet Explorer Netscape Opera Safari Firefox
Version 5.5 6.0 7.0 8.0 8.0 9.0 7.0 8.0 9.2 9.5 1.3 2.0 3.1 1.5 2.0 3.0
Supported Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Short information
CSS CSS1
Default value normal
Inherited Yes
Applied To all elements
HTML analog No
Reference to specification http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height
Description
It determines line spacing of a text. Readout is conducted from a font basic line. Under usual circumstances the distance between lines depends on a font kind and a font size and is defined by a browser automatically. Negative value of inter lower case distance is not supposed.

Syntax

line-height: normal |	multiplier | value | percent
Arguments
Value normal forces a browser to calculate distance between lines automatically. Any number of more zero is perceived as a multiplier from a font size of the current text. For example, value 1.5 determines one-and-a-half line spacing. Any length units in CSS are accepted as values — for example, pixels (px), inches (in) are accepted, points (pt), etc. It is allowed to use percentage record. In this case the font height undertakes 100 percent.

Example

 
<!--
   H1 {
    line-height: 60%;
   } 
   P {
    line-height: 1.5;
   }
 
-->
<h1>Duis te feugifacilisi</h1>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
  nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
  Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
  lobortis nisl ut aliquip ex ea commodo consequat.
The result of this example is shown on the figure 1

Object model
[window.]document.getElementById("elementID").style.lineHeight