SyntaxStudy
Sign Up
Home CSS Reference line-height

line-height

property

Sets the height of a line box. Unitless values (like 1.5) are recommended for better scaling.

Syntax

line-height: number | length | normal;

Example

css
body {
    line-height: 1.6;    /* unitless: 1.6x font-size */
}

h1 {
    line-height: 1.2;    /* tighter for headings */
}

.compact {
    line-height: 1;      /* single line */
}

.spacious {
    line-height: 2;      /* double spacing */
}