Easy Tutorial
❮ Css Colors Func Rgb Css ❯

CSS line-height Property

Example

Setting line height with percentages:

p.small { line-height: 90%; }
p.big { line-height: 200%; }

Property Definition and Usage

Sets the line height in percentage:

Note: Negative values are not allowed.

Default value: normal
Inherited: yes
--- ---
Version: CSS1
--- ---
JavaScript syntax: object.style.lineHeight="2"
--- ---

Browser Support

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

Property
line-height 1.0 4.0 1.0 1.0 7.0

Property Values

Value Description
normal Default. Sets a reasonable line spacing.
number Sets a number, which is multiplied by the current font size to set the line spacing.
length Sets a fixed line spacing.
% Line spacing based on the percentage of the current font size.
inherit Specifies that the value of the line-height property should be inherited from the parent element.

More Examples

Setting line spacing with pixel values

Setting line spacing with numeric values


Related Articles

CSS Tutorial: CSS Text

❮ Css Colors Func Rgb Css ❯