Search within TutorialsPark

CSS line-height Property


To set the height of a line of text


Definition and Notes.

1. The CSS line-height property is used to set the amount of space between lines of text.

2. Initial Value is normal(default line height), percentage values are relative to the font-size.


Syntax:

CSS line-height property. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note- When line-height is applied to block level elements, it sets the minimum distance between baselines within that element.

Property Values

Value Description
normal The height is normal. Its the default
number The elements font-size is multiplied by the given number
length To set the line-height using length values(px, pt, cm, em)
% To set the line-height using percentage values
inherit The line-height of the parent element is inherited by the child elements

Specifications

Specs Value
Name line-height
Value <length> | <percentage> | <number> | normal | none
Initial Value normal
Applies to all elements(but see text regarding replaced and block-level elements)
Javascript syntax object.style.lineHeight="10px"
Inherited Yes
Percentages Relative to the font-size of the element
Computed Value For length and percentage values, the absolute length; otherwise,same as declared value
Browser Support internetexplorer safari firefox opera chrome

Related Examples.