CSS - line-height


Description:

The line-height property modifies the height of the inline boxes which make up a line of text.

Possible Values:

  • normal:Directs the browser to set the height of lines in the element to a "reasonable" distance.
  • number: The actual height of lines in the element is this value multiplied by the font-size of the element.
  • length: The height of lines in the element is the value given.
  • percentage: The height of lines in the element is calculated as a percentage of the element's font-size.

Applies to:

All the HTML elements.

DOM Syntax:

object.style.lineHeight="15px;"

Example:

Following is the example:

<p style="line-height:180%">
This text is having bigger line height. Line 1
This text is having bigger line height. Line 2
</p>
     

This will produce following result:

This text is having bigger line height. Line 1 This text is having bigger line height. Line 2

 





Spacer Bottom Left Corner ImageBottom Right Corner Image
Valid XHTML 1.0 Strict  Valid CSS! Check the accessibility of this site according to U.S. Section 508