Choose whether wrapping, flexible tracks, or a conditional rule should respond to a change in available space.
A layout can look comfortable on a wide screen and crowd its labels when the same page is narrower. Responsive design starts by locating the first piece of content that runs out of room.
A paragraph can wrap as its containing block narrows. Flexbox can move a control onto another line, and Grid can fit fewer columns when the minimum track widths and gaps no longer fit. These behaviors follow from the layout rules you already know. They also work when a narrow sidebar shares a wide screen with the main article.
Watch a row of controls as you narrow its container. If a whole control can move onto the next line and remain easy to read, wrapping can solve the problem by itself. If the controls must change from a row to a full-width stack, decide where that arrangement becomes necessary.
The width at which a conditional layout changes is a breakpoint. Pick it by looking at the content. A longer label or larger text can expose a problem between two familiar device widths.
A width media query tests the viewport, the area available for the page. It fits a decision about the whole page, such as making room for a second main column. A size container query tests an eligible ancestor. It fits a card that needs a compact arrangement in a sidebar even when the viewport stays wide.
Try it yourself
HTML + CSS