query-feature

Size/inline size — CSS reference

The inline-size feature compares the logical inline dimension. In vertical writing mode it corresponds to physical height, so the 120px height is queried here.

Formal Syntax & Structure

css syntaxcss
@container (inline-size = 120px) { /* descendant styles */ }

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>size/inline-size</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;writing-mode:vertical-rl;container-type:inline-size}@container (inline-size = 120px){#a{color:rgb(0,100,0)}}</style><body><section id="box"><div id="a">Component</div></section></body></html>
CSS Reference