The line-height property sets the height of a line box. In everyday horizontal text, that mainly controls how far lines sit apart (leading).
The initial value is normal (often about 1.2, font-dependent). Prefer a unitless number such as 1.5 so children scale with their own font-size. It is inherited. You can also set it inside the font shorthand.
Baseline widely available.
Not deprecated. For main paragraphs, aim for about 1.5 or higher for accessibility. Prefer unitless values over em / % when the value will be inherited.
The heading may inherit a line-height computed from 16px, not 32px.
How It Works
Parent sets em.1.5em of 16px becomes a fixed computed length (24px).
Child inherits that length. The large h1 can get cramped leading.
Percentages act similarly. They also resolve to a length before inheritance.
Fix: use line-height: 1.5 (unitless) on the parent instead.
Edge Cases & Pitfalls
Most line-height bugs come from units and inheritance.
units
Prefer unitless numbers
em and % resolve to a length, then children inherit that length. Unitless values keep multiplying each element’s own font size.
a11y
Body text needs room
Very tight leading makes long paragraphs hard to follow. About 1.5 or more is a solid accessibility baseline for main copy.
font
normal is not one fixed number
Browsers often use ~1.2, but the exact result can depend on the font-family.
shorthand
font can set it too
font: 16px/1.5 sans-serif sets size, line-height, and family together via the font shorthand.
letter
Not letter spacing
Gaps between characters belong to letter-spacing. Line-height is about line boxes.
Compatibility
Browser Support
line-height is a browser CSS property for typography. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
line-height
normal, unitless numbers, lengths, and percentages are widely supported in all modern browsers.
100%Common values
Google ChromeAll versions
Full support
Mozilla FirefoxAll versions
Full support
Apple SafariAll versions
Full support
Microsoft EdgeAll versions
Full support
OperaAll versions
Full support
Samsung InternetAll versions
Full support
Internet ExplorerAll versions
Full support
line-heightWidely supported
Bottom line: Safe everywhere. Prefer unitless numbers for inherited body text. It is not a runtime API.
Remember
Key Takeaways
Role: set the height of line boxes — the space between lines of text.
Initial value:normal. Inherited.
Best practice: use unitless numbers such as 1.5.
Accessibility: keep main paragraphs near 1.5 or above.
One line:line-height: 1.5 is the simple, scalable way to give body text comfortable leading.
Frequently Asked Questions
It sets the height of each line box for text. In horizontal writing modes, that mainly controls the vertical space between lines.
The initial value is normal. Desktop browsers often treat that as roughly 1.2, depending on the font.
A unitless value multiplies each element’s own font-size and inherits more predictably. Lengths and percentages can leave child headings with the parent’s computed height.
Yes. Setting it on body or a container affects nested text unless a child overrides it.
For main paragraph content, aim for at least about 1.5 so low-vision and dyslexic readers can follow lines more easily.
It is Baseline and widely available. It is a browser CSS property, not a Node.js feature.