Skip to content
Skip the list of specifications

stroke-width

matches Chrome on some values: 4 of 6 decided examples match Chrome; 2 not decided

fill-stroke-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: stroke-width:40%, stroke-width:0.4. They come first below, each with its difference map.

What the specification says

Initial value1px
Applies totext and SVG shapes
Inheritedyes
Percentagesrelative to the scaled viewport size
Computed valuethe absolute length, or percentage
Syntax[ <length-percentage> | <line-width> | <number> ]#

The definition in fill-stroke-3

The measurements

8 examples: two render differently and come first, four match Chrome and two are not decided. 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.

stroke-width:40%

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 Chrome1,274
The same, on the page without the declaration863
Largest difference on one colour channel204 of 255
The same, on the page without the declaration204 of 255

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

The example’s page

stroke-width:0.4

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 Chrome1,860
The same, on the page without the declaration863
Largest difference on one colour channel204 of 255
The same, on the page without the declaration204 of 255

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

The example’s page

stroke-width:2

not decided
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 Chrome942
The same, on the page without the declaration863
Largest difference on one colour channel204 of 255
The same, on the page without the declaration204 of 255

The pages differ by 942 pixels with the declaration and by 863 without it: a little more, but within the difference the text already makes, so the measurement does not decide this example.

The example’s page

stroke-width:4px

not decided
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 Chrome925
The same, on the page without the declaration863
Largest difference on one colour channel204 of 255
The same, on the page without the declaration204 of 255

The pages differ by 925 pixels with the declaration and by 863 without it: a little more, but within the difference the text already makes, so the measurement does not decide this example.

The example’s page

stroke-width: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 Chrome582
The same, on the page without the declaration863
Largest difference on one colour channel153 of 255
The same, on the page without the declaration204 of 255

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

The example’s page

stroke-width: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 Chrome848
The same, on the page without the declaration863
Largest difference on one colour channel204 of 255
The same, on the page without the declaration204 of 255

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

The example’s page

stroke-width: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 Chrome673
The same, on the page without the declaration863
Largest difference on one colour channel153 of 255
The same, on the page without the declaration204 of 255

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

The example’s page

stroke-width:calc(20px + 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 Chrome790
The same, on the page without the declaration863
Largest difference on one colour channel204 of 255
The same, on the page without the declaration204 of 255

The pages differ by 790 pixels with the declaration and by 863 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 7 branches, and 3 of them carry a measurement.

ValueMeasured
20px
4px
calc(20px + 4px)
same effect as Chrome
not decided
same effect as Chrome
50%
40%
calc(40% + 20px)
same effect as Chrome
renders differently
same effect as Chrome
hairlinenot measured
thinnot measured
mediumnot measured
thicknot measured
2
0.4
not decided
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