Standard

CSS Container Query Generator

Build a container query that responds to its parent's width, not the viewport — drag the box below to see it in action.

Card title

This card's layout changes once the container crosses your chosen breakpoint — resize the dashed box to see it.

Drag the bottom-right corner of the dashed box to resize it →
Advertisement

About this tool

Container queries let a component adapt to the size of its own container rather than the whole viewport — useful for a card or widget that gets reused at different widths across a page. Requires setting container-type on a parent element first, which this generator includes.