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 value | none |
|---|---|
| Applies to | See below |
| Inherited | no |
| Percentages | n/a |
| Computed value | the keyword none or one or more of size, layout, style, paint |
| Syntax | none | strict | content | [ [size | inline-size] || layout || style || paint ] |
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

| Pixels that differ from Chrome | 1,402 |
|---|---|
| The same, on the page without the declaration | 1,402 |
| Largest difference on one colour channel | 45 of 255 |
| The same, on the page without the declaration | 45 of 255 |
Our page is the same with and without the declaration; Chrome’s page changes.
contain:strict
same effect as Chrome

| Pixels that differ from Chrome | 0 |
|---|---|
| The same, on the page without the declaration | 1,402 |
| Largest difference on one colour channel | 0 of 255 |
| The same, on the page without the declaration | 45 of 255 |
Identical to Chrome.
contain:size
same effect as Chrome

| Pixels that differ from Chrome | 1,402 |
|---|---|
| The same, on the page without the declaration | 1,402 |
| Largest difference on one colour channel | 48 of 255 |
| The same, on the page without the declaration | 45 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.
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.
| Value | Measured |
|---|---|
strict | same effect as Chrome |
content | parsed, no effect |
size | same effect as Chrome |
inline-size | not measured |
layout | not measured |
style | not measured |
paint | parsed, no effect |
none | not 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