← TechnologyThe essentials of

container-type: preparing an element for size queries

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 13:48. This is not editorial approval.

In a few sentences

In brief

The container must explicitly participate in this type of CSS requests.

Useful to know

container-type: inline-size establishes a container for size checks along its inline axis. In ordinary horizontal writing, this is the dimension we perceive as width. [1]

Example: .card-host { container-type: inline-size; }. After this rule, @container can change children according to the available space. When the same card stands in a narrow side panel, and in a wide column, the reaction to the container is more accurate than a reaction only to the screen. The declaration also introduces containment consequences; check the size of the wrapper rather than adding it randomly anywhere.

Sources

For further detail and to check the information:

  1. [1] MDN — container-type ↗