Advertisement
Cols3
Rows3
Cells9
Gap12px
Build CSS Grid container layouts visually. 1-8 columns × 1-8 rows, per-axis unit picker (fr / px / % / auto), independent column-gap and row-gap, and all four alignment properties (justify-items, align-items, justify-content, align-content). Live preview with colored grid cells so you can see structure at a glance.
5 framework exports + URL hash permalink. No login, no watermark, no paywall. Free and MIT-licensed.
| Property | Description |
|---|---|
grid-template-columns | Defines the width of each column track. Accepts fr, px, %, auto, or repeat(). |
grid-template-rows | Defines the height of each row track. Same value types as columns. |
gap | Shorthand for row-gap and column-gap. Sets space between tracks. |
justify-items | Aligns grid items horizontally within their cell: stretch | start | center | end. |
align-items | Aligns grid items vertically within their cell: stretch | start | center | end. |
justify-content | Aligns the whole column axis within the container when tracks don't fill it. |
align-content | Aligns the whole row axis within the container when tracks don't fill it. |
display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
display: grid; grid-template-columns: 200px 1fr 1fr; grid-template-rows: auto; gap: 12px;
display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); column-gap: 16px; row-gap: 8px; justify-items: stretch; align-items: stretch;
CSS Grid has excellent modern browser support. IE 11 has an older, partial implementation with a different syntax — avoid relying on it without a polyfill.