← All tools

CSS Container Query Generator

Generate named or unnamed container styles and min-width queries with three editable breakpoints.

css-container-query-generatorLOCAL WORKSPACE

Enabling local controls…

Settings

Minimum widths

Leave unused breakpoints blank. Output follows field order and uses min-width in horizontal writing mode. size contains both axes.

Results

CSS

.query-container {
  container-type: inline-size;
  container-name: card;
}

/* 400px */
@container card (min-width: 400px) {
  .card{flex-direction:row}
}

/* 700px */
@container card (min-width: 700px) {
  .card{flex-direction:row}
}

/* 1000px */
@container card (min-width: 1000px) {
  .card{flex-direction:row}
}
Download CSS

How to use this tool

Choose a preset or edit the controls. Copy the result or download it when it is ready.

When not to use it

Set up the container selector on a parent of the elements you style. normal only generates container setup.