PropertyBaseline: widely availablesince September 2024
MDN The containCSS property indicates that an element and its contents are, as much as possible, independent from the rest of the document tree. Containment enables isolating a subsection of the DOM, providing performance benefits by limiting calculations of layout, style, paint, size, or any combination to a DOM subtree rather than the entire page. Containment can also be used to scope CSS counters and quotes.
<section class="default-example" id="default-example"> <div class="card" id="example-element"> <h2>Element with '<code>contain</code>'</h2> <p> The Goldfish is a species of domestic fish best known for its bright colors and patterns. </p> <div class="fixed"><p>Fixed right 4px</p></div> </div></section>
MDN The content-visibilityCSS property controls whether or not an element renders its contents at all, along with forcing a strong set of containments, allowing user agents to potentially omit large swathes of layout and rendering work until it becomes needed. It enables the user agent to skip an element's rendering work (including layout and painting) until it is needed — which makes the initial page load much faster.