CSS Grid Generator
Build a CSS grid layout visually. Set column and row tracks (using fr, px, %, or auto), control gaps, and see the result on real grid items. Copy the generated CSS.
How to use the CSS Grid Generator
Type column and row track lists in normal CSS Grid syntax: 1fr 2fr 1fr, repeat(3, 1fr), 200px auto, repeat(auto-fill, minmax(120px, 1fr)). The preview updates live. Quick presets cover common layouts.
Two-dimensional layout with CSS grid
CSS Grid lays content out in rows and columns at the same time, and its real power is the track syntax: the fr unit splits leftover space into fractions, repeat() avoids repetition, minmax() sets flexible bounds, and auto-fill creates as many tracks as fit. Typed blind, these are hard to picture; rendered on real items, they make immediate sense.
Enter column and row track lists in normal grid syntax and watch the layout update live, with presets for a 3×2 grid, an auto-fill card grid, and a sidebar layout. For single-axis layouts — a nav bar, a centered row — the flexbox playground is simpler, and the grid-to-flex converter shows the same patterns built both ways.
Common use cases
- Page layouts — build header, sidebar, main, and footer regions.
- Card grids — use auto-fill with minmax for responsive galleries.
- Dashboards — place widgets across a fixed track structure.
- Forms — align labels and inputs into clean columns.
- Learning grid — experiment with fr, repeat, and minmax visually.