CSS Grid Layout Generator
Design a CSS grid visually, watch the live preview, then copy the clean CSS and HTML skeleton.
Columns and rows
Alignment
Demo items
The demo items only appear in the preview below. The exported HTML skeleton uses placeholder item divs you can replace.
Live preview
updates as you change settingsGenerated CSS
HTML skeleton
Property legend
| Property | What it does |
|---|---|
| display: grid | Turns the container into a grid layout container. |
| grid-template-columns | Defines the width of each column. 1fr means one share of the free space. |
| grid-template-rows | Defines the height of each row. |
| gap | Space between rows and columns, written as row gap then column gap. |
| justify-items | Aligns each item left, center, right, or stretched inside its own cell. |
| align-items | Aligns each item top, middle, bottom, or stretched inside its own cell. |
| justify-content | Aligns the whole grid horizontally inside the container when there is extra space. |
| align-content | Aligns the whole grid vertically inside the container when there is extra space. |
Frequently Asked Questions (FAQ)
What does the CSS Grid Layout Generator do?
You set the number of columns and rows, their sizes, the gap, and alignment, and the tool shows a live visual preview and generates ready-to-use CSS plus a minimal HTML skeleton.
Can I use units like fr and px in track sizes?
Yes. Type any valid track sizes such as 1fr 200px auto, one per column or row, separated by spaces. The preview updates to match exactly what the CSS will do.
What is the property legend for?
The read-only legend explains each generated CSS property in plain words, so you understand what grid-template-columns, gap, and the alignment properties actually do.
Is the generated CSS responsive?
The snippet uses the track sizes you enter. Use fr units or minmax values, for example repeat(2, 1fr), to build layouts that adapt to different screen widths.