CSSworkingevergreen

Responsive grid without media queries

Fluid card grids that reflow themselves.

One line of grid-template-columns — repeat(auto-fit, minmax(min, 1fr)) — gives you a grid that adds and drops columns as space allows, no breakpoints to hand-tune.

auto-fit card grid (resize me)

HTML+CSS+JSintro
Press Run to execute

The six cards lay themselves out in as many minmax(160px, 1fr) columns as the container's current width allows, with no @media rules in sight. Drag the resize handle on the bottom-right and the grid adds a column every time another 160px track fits and drops one when it no longer does — the cards always stretch via 1fr to fill the row exactly.