CSS contain Property Reference

The CSS contain property is a standard property in CSS Containment. Review its formal syntax, computed behavior, and practical declarations.

CSS contain Property Reference

The CSS contain property is a standard property in CSS Containment. Review its formal syntax, computed behavior, and practical declarations.

Updated 2026-08-12

contain overview

The CSS contain property is a standard property in CSS Containment. Review its formal syntax, computed behavior, and practical declarations.

The property is not inherited by default. Use an explicit global keyword when inheritance is intended.

Syntax and formal definition

contain formal syntax
FieldValue
Formal syntaxnone | strict | content | [ [ size || inline-size ] || layout || style || paint ]
Initial valuenone
Applies toallElements
InheritedNo
Percentagesno
Computed valueasSpecified
Animation typenotAnimatable
Mediaall
Specification groupCSS Containment
StatusStandard

Practical examples

These declarations demonstrate valid ways to set contain. The initial and inherit global keywords remain available even when a property-specific value is preferable.

contain live example
CSS .reset-example { contain: initial; } .inherit-example { contain: inherit; } @supports (contain: initial) { .supported { contain: initial; } }

Description

The CSS contain property is a standard property in CSS Containment. Review its formal syntax, computed behavior, and practical declarations.

References

  1. MDN: contain
  2. MDN: CSS Properties Reference

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies