line-height property is similar to leading in desktop publishing — it determines the "line height". This results in lines of text appearing closer together or further apart.
On a block container element whose content is composed of inline-level elements,
line-height specifies the minimal height of line boxes within the element.
On a non-replaced inline element,
line-height specifies the height that is used in the calculation of the line box height.
line-height property accepts the following values.
- Specifies that the user agent should use a "reasonable" value based on the font of the element. This is typically between
- Specifies the line height using a length value (for example
1.3em). The specified length is used in the calculation of the line box height. Negative values are illegal.
- Specifies the line height using a number value (for example
1.3). The used value of the property is this number multiplied by the element's font size. Negative values are illegal.
- Specifies the line height using a percentage value (for example
130%). The computed value of the property is this percentage multiplied by the element's computed font size. Negative values are illegal.
In addition, all CSS properties also accept the following CSS-wide keyword values as the sole component of their property value:
- Represents the value specified as the property's initial value.
- Represents the computed value of the property on the element's parent.
- This value acts as either
initial, depending on whether the property is inherited or not. In other words, it sets all properties to their parent value if they are inheritable or to their initial value if not inheritable.
- Initial Value
- Applies To
- All elements
- Yes (see example)