query-feature
Size/height — CSS reference
The height feature compares the physical content-box height. In horizontal writing mode inline-size alone cannot satisfy a height query; use size when both axes must be queried.
Formal Syntax & Structure
css syntaxcss
@container (height = 120px) { /* descendant styles */ }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>size/height</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}#box{width:240px;height:120px;container-type:size}@container (height = 120px){#a{color:rgb(0,100,0)}}</style><body><section id="box"><div id="a">Component</div></section></body></html>