Widely availableSupported across all major browsers. Safe to use in production.

Overview

The line-height CSS property sets the spacing between text baselines, oriented to the horizontal or vertical writing mode.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
1
1
18
1
normal
1
12
1
1
18
1
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

CSS
body {
  line-height: 1.6;
}
h1 {
  line-height: 1.2;
}

Live demo

1.0

CSS 1.0 demo.

PreviewFullscreen

1.6(recommended)

CSS 1.6(recommended) demo.

PreviewFullscreen

2.0(wide)

CSS 2.0(wide) demo.

PreviewFullscreen

Use cases

  • Using line-height

    The line-height CSS property sets the spacing between text baselines, oriented to the horizontal or vertical writing mode.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Make sure visual changes are conveyed appropriately to assistive technology.

Powered by web-features