Skip to content
Skip the list of specifications

contain

matches Chrome on some values: 2 of 4 examples match Chrome

css-contain-2

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: contain:content, contain:paint. They come first below, each with its difference map.

What the specification says

Initial valuenone
Applies toSee below
Inheritedno
Percentagesn/a
Computed valuethe keyword none or one or more of size, layout, style, paint
Syntaxnone | strict | content | [ [size | inline-size] || layout || style || paint ]

The definition in css-contain-2

The measurements

4 examples: two render differently and come first and two 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.

contain:content, contain:paint

parsed, no effect
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

Our page is the same with and without the declaration; Chrome’s page changes.

The example’s page

contain:strict

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 Chrome0
The same, on the page without the declaration1,402
Largest difference on one colour channel0 of 255
The same, on the page without the declaration45 of 255

Identical to Chrome.

The example’s page

contain:size

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 channel48 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 8 branches, and 4 of them carry a measurement.

ValueMeasured
strict
same effect as Chrome
content
parsed, no effect
size
same effect as Chrome
inline-sizenot measured
layoutnot measured
stylenot measured
paint
parsed, no effect
nonenot measured

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