CSS containment lets you tell the browser that a DOM subtree is independent of the rest of the page, allowing it to skip unnecessary layout, paint, and style recalculation work. The contain property accepts four values: layout (isolates internal layout), paint (clips painting to the element's box), size (decouples element size

16m read timeFrom csswizardry.com
Post cover image
Table of contents
Why Containment ExistsMeet the contain PropertyLayout ContainmentPaint ContainmentSize ContainmentStyle ContainmentSpecial Values: content and strictContainment in the Real Worldcontent-visibility and contain-intrinsic-sizeCaveats, Gotchas, and Things to Watch forWhen to Use ContainmentClosing Thoughts
2 Comments

Sort: