Skip to content
The CSS Chamber of Measures

/static/camara/en/unidade/cqw-cqh/

Menu

CSS-018 · Container

cqw · cqh

One percent of the query container — width, at last, made local.

One cqw is 1% of the width of the nearest query container — the ancestor declared with container-type — and one cqh, 1% of its height. For the first time a unit measures the component's vessel, not the whole window. With no container around, they fall back to the small viewport units.

It is the right choice for components living in columns of varied widths: the same card, its heading set in 6cqw, composes large in the wide column and small in the narrow one — fluid typography without a single media query.

width:50cqw
.cartao {
  container-type: inline-size;
}
.cartao h3 {
  font-size: 6cqw;
}
Live demonstration: the bar measures 50cqw — half of the dashed frame, which is a real container.