-
The
line-height
CSS property sets the height of a line box in horizontal writing modes - In vertical writing modes, it sets the width of a line box
- It's commonly used to set the distance between lines of text
- On block-level elements in horizontal writing modes, it specifies the preferred height of line boxes within the element, and on non-replaced inline elements, it specifies the height that is used to calculate line box height
Values
-
normal
- Depends on the user agent
-
Desktop browsers (including Firefox) use a default value of roughly
1.2
, depending on the element's font-family
-
<number> (unitless)
-
The used value is this unitless
<number>
multiplied by the element's own font size - The computed value is the same as the specified <number>
-
In most cases, this is the preferred way to set
line-height
and avoid unexpected results due to inheritance
-
The used value is this unitless
-
<length>
-
The specified
<length>
is used in the calculation of the line box height -
Values given in
em
units may produce unexpected results
-
The specified
-
<percentage>
- Relative to the font size of the element itself
-
The computed value is this
<percentage>
multiplied by the element's computed font size -
Percentage
values may produce unexpected results