CSS line-height Property

❮ Previous Reference Next ❯

Example

h1 {
  line-height: 5.5;
}

p {
  line-height: 500%;
}





Lorem Ipsum is simply dummy text of the printing and typesetting industry.


Meaning

The line-height property sets the height (leading) between lines of text in a block-level element such as a paragraph.

Values can be specified as a number of lines, a number of units (pixels, points, inches, centimeters, and so on), or a percentage of the font size.

Note: Negative values are not allowed.

The default value of normal is typically equivalent to 1.0 to 1.2 depending on the implementation.

Default value:normal
Inherited:Yes
Animatable:Yes
Version:CSS1
JavaScript syntax:
object.style.lineHeight="normal|number|length|%|initial|inherit|revert|revert-layer|unset";



Standard Syntax

line-height: normal|number|length|%|initial|inherit|revert|revert-layer|unset;



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







Property Values

The following table describes the values of this property.

Value Description
normal This is default value. Specifies a normal line height.
number Specifies a number that will be multiplied with the current font-size to set the line height.
length Specifies a fixed line height in px, pt, cm, etc.
%(percentage) Specifies a line height in percent of the current font size.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.



Default CSS Property Values

selectors {
  line-height: normal;
}
❮ Previous Reference Next ❯