Start a project

Tool 96 of 425 · CSS

CSS Container Query Builder

Writes container-type, container-name and @container rules, and shows which rules apply at a container width you set.

CSS Container Query Builder

Your input

Result

CSS
ConditionAt test widthCSS

    01

    What it does

    Writes container-type, container-name and @container rules, and shows which rules apply at a container width you set.

    • inline-size or size containment
    • Named containers
    • Range syntax and min/max-width conditions
    • Live width test with a preview box

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Container query CSS and a match table, with a Copy and a Download button on every result.

    • Container queries
    • @container
    • Responsive CSS

    Why it matters

    Media queries respond to the screen; container queries respond to the space a component actually has. A card can switch to a two-column layout when its sidebar slot is wide enough, wherever it is placed.

    This builder writes the containment and the queries together and lets you test a width, so you can see which rules will apply before you try it in the browser.

    How to use it

    1. Type or paste your input; the example shows the format.
    2. Press Build CSS. Results also update as you type.
    3. Read the summary line, then the table, notes or output below it.
    4. Copy or download what you need. Nothing leaves this page.

    FAQ

    Why doesn't my container query work?

    The query applies to descendants of an element with container-type set. You can't style the container itself from its own query, and size containment needs an explicit height.

    Is my input uploaded?

    No. The tool runs in your browser and nothing you type, paste or open is sent anywhere.

    Can I rely on the result?

    It follows the public specification or formula named on this page and says where it simplifies. Check anything critical against the official tool or documentation before you ship it.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk