Skip to content
Skip the list of specifications

line-height

matches Chrome on some values: 7 of 9 examples match Chrome

css-inline-3

Some of the examples match Chrome and some do not: the count says how many, and the values that differ are listed first, each with its difference map.

The 2 that do not: line-height:normal, line-height:calc(20px + 4px). They come first below, each with its difference map.

What the specification says

Initial valuenormal
Applies tonon-replaced inline boxes and SVG text content elements
Inheritedyes
Percentagescomputed relative to 1em
Computed valuethe specified keyword, a number, or a computed <length> value
Syntaxnormal | <number [0,∞]> | <length-percentage [0,∞]>

The definition in css-inline-3

The measurements

9 examples: two render differently and come first and seven match Chrome. Each is one declaration on a small page, drawn by Chrome and by our engine. Drag on a picture to move the line between them.

line-height:normal, line-height:calc(20px + 4px)

renders differently
Chrome rendering
Ours rendering
Left of the line is ours, right of it Chrome’s rendering. Drag on the picture to move the line.
Pixels that differ from Chrome2,132
The same, on the page without the declaration1,402
Largest difference on one colour channel45 of 255
The same, on the page without the declaration45 of 255

The declaration takes effect differently from Chrome: the difference map shows where.

The example’s page

line-height:2

same effect as Chrome
Chrome rendering
Ours rendering
Left of the line is ours, right of it Chrome’s rendering. Drag on the picture to move the line.
Pixels that differ from Chrome1,402
The same, on the page without the declaration1,402
Largest difference on one colour channel45 of 255
The same, on the page without the declaration45 of 255

The pages differ by 1,402 pixels with the declaration and by 1,402 without it: what differs is there before the property (mostly the fonts), and the declaration does not add to it.

The example’s page

line-height:50%

same effect as Chrome
Chrome rendering
Ours rendering
Left of the line is ours, right of it Chrome’s rendering. Drag on the picture to move the line.
Pixels that differ from Chrome1,283
The same, on the page without the declaration1,402
Largest difference on one colour channel48 of 255
The same, on the page without the declaration45 of 255

The pages differ by 1,283 pixels with the declaration and by 1,402 without it: what differs is there before the property (mostly the fonts), and the declaration does not add to it.

The example’s page

line-height:20px

same effect as Chrome
Chrome rendering
Ours rendering
Left of the line is ours, right of it Chrome’s rendering. Drag on the picture to move the line.
Pixels that differ from Chrome1,376
The same, on the page without the declaration1,402
Largest difference on one colour channel48 of 255
The same, on the page without the declaration45 of 255

The pages differ by 1,376 pixels with the declaration and by 1,402 without it: what differs is there before the property (mostly the fonts), and the declaration does not add to it.

The example’s page

line-height:4px

same effect as Chrome
Chrome rendering
Ours rendering
Left of the line is ours, right of it Chrome’s rendering. Drag on the picture to move the line.
Pixels that differ from Chrome617
The same, on the page without the declaration1,402
Largest difference on one colour channel48 of 255
The same, on the page without the declaration45 of 255

The pages differ by 617 pixels with the declaration and by 1,402 without it: what differs is there before the property (mostly the fonts), and the declaration does not add to it.

The example’s page

line-height:0.4, line-height:40%

same effect as Chrome
Chrome rendering
Ours rendering
Left of the line is ours, right of it Chrome’s rendering. Drag on the picture to move the line.
Pixels that differ from Chrome1,076
The same, on the page without the declaration1,402
Largest difference on one colour channel48 of 255
The same, on the page without the declaration45 of 255

The pages differ by 1,076 pixels with the declaration and by 1,402 without it: what differs is there before the property (mostly the fonts), and the declaration does not add to it.

The example’s page

line-height:calc(40% + 20px)

same effect as Chrome
Chrome rendering
Ours rendering
Left of the line is ours, right of it Chrome’s rendering. Drag on the picture to move the line.
Pixels that differ from Chrome1,402
The same, on the page without the declaration1,402
Largest difference on one colour channel45 of 255
The same, on the page without the declaration45 of 255

The pages differ by 1,402 pixels with the declaration and by 1,402 without it: what differs is there before the property (mostly the fonts), and the declaration does not add to it.

The example’s page

Which values were measured

A match on one example means a match at the value tried. The property’s grammar has 4 branches, and 4 of them carry a measurement.

ValueMeasured
2
0.4
same effect as Chrome
same effect as Chrome
20px
4px
calc(20px + 4px)
same effect as Chrome
same effect as Chrome
renders differently
50%
40%
calc(40% + 20px)
same effect as Chrome
same effect as Chrome
same effect as Chrome
normal
renders differently

Measured against Chrome 148.0.7778.96 on 5 November 2026, with up to 40 candidate values tried per property. How it was measured