CSS contain Property
The contain CSS property specifies 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.
The following table describes the values of this property:
|The element renders as normal, with no containment applied.
|All containment rules are applied to the element. This is equivalent to contain: size; layout paint style.
|All containment rules except size are applied to the element. This is equivalent to contain: layout; paint style.
|Size containment is applied to the element in both the inline and block directions. The size of the element can be computed in isolation, ignoring the child elements. This value cannot be combined with inline-size.
|Inline size containment is applied to the element. The inline size of the element can be computed in isolation, ignoring the child elements. This value cannot be combined with size.
|The internal layout of the element is isolated from the rest of the page. This means nothing outside the element affects its internal layout, and vice versa.
|For properties that can affect more than just an element and its descendants, the effects don't escape the containing element. Counters and quotes are scoped to the element and its contents.
|Descendants of the element don't display outside its bounds.
|Sets this property to its default value.
|If specified, the associated element takes the computed value of its parent element animation-delay property.
|Reverts the cascaded value of the property from its current value to the value the property
|Rollback styles to the ones specified in previous cascade layers.
|Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.
Default CSS Property Values