Code · Made a little simpler

Container Query Builder

Set a container name and size condition, then resize the local preview to verify the computed layout. Copy or download the resulting CSS.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

280 px selected · 280 px measured · 1 column

Arrival
09:30
Setup
10:00
Workshop
10:30
Review
12:00

Place an element with class cq-layout inside an element with class cq-container. The preview width is separate from the exported rule.

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

Container Query Builder: how to use it

  1. Enter the container name and choose At least, At most or Between.
  2. Set the width thresholds and matching grid columns and gap.
  3. Move Preview container width through the boundary, compare the measured columns and export the CSS.

Limits and notes

Accepts whole-pixel thresholds from 120 to 960, two to four matching columns, and gaps up to 32 pixels. The preview runs inside your browser and uses a named inline-size container.

How your privacy works →

Container Query Builder: common questions

Which element should get the container declaration?

Apply it to a parent of the element whose layout changes. The query applies its grid rules to the descendant.

Does At least include the exact threshold?

Yes. A min-width condition of 360 px starts matching at 360 px.

Can I verify a width range?

Choose Between and enter minimum and maximum widths. The preview applies the layout inside both inclusive boundaries.

Guides