display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 100px); gap: 12px;
e.g. 1fr, 200px, minmax(0,1fr)
How to use
Choose your track counts
Enter a column count and a row count in the two number inputs, anywhere from 1 to 12 each. The preview redraws the cells instantly, numbering every one so you can count placements.
Size the tracks
Type a value into Column size and Row size. The fields accept any CSS track sizing: 1fr for equal shares, 200px for fixed tracks, minmax(0,1fr) to stop content blowouts. Adjust the gap slider to taste.
Copy the container rule
The CSS pane shows display: grid with grid-template-columns, grid-template-rows, and gap, all using repeat() notation. Hit the copy button and paste it onto your wrapper element to place its children into cells.
Why CSS Grid Generator
- Visual CSS Grid builder with live preview.
- Choose column count, row count, sizing track values, and gap.
- Supports any track size unit, fr, px, %, auto, minmax().