property
Contain — CSS reference
contain declares selected types of isolation for an element’s subtree. Layout, paint, style, size and inline-size affect different behavior; choose only the needed boundaries. Layout and paint containment establish positioning and stacking boundaries, while paint clips overflow.
Formal Syntax & Structure
css syntaxcss
contain: layout paint;Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>contain</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}#box{width:150px;contain:layout paint}</style><body><section id="box"><div id="child" style="width:100px;height:60px">Content</div></section></body></html>