Create custom grid layouts – columns, rows, gaps, padding & alignment. Live preview & code
Want to embed this CSS grid generator on your website? Use this code:
Using auto-fit, minmax, and auto-fill for fluid layouts.
Read Tutorial →| Feature | Our Tool | Tool A | Tool B |
|---|---|---|---|
| Free & unlimited | ✅ | ✅ | ❌ (limit) |
| Live preview | ✅ | ✅ | ✅ |
| Custom column/row units | ✅ (6 units) | ✅ (3 units) | ✅ |
| Gap & padding | ✅ | ✅ | ❌ |
| Alignment controls (8 options) | ✅ | ❌ | ✅ |
| Download CSS file | ✅ | ❌ | ✅ |
| Client-side / private | ✅ | ❌ | ✅ |
justify-items aligns the content inside each grid cell horizontally. justify-content aligns the entire grid container horizontally when there is extra space.
fr stands for "fraction". It distributes available space proportionally. For example, 1fr 2fr means the second column takes twice as much space as the first.
This generator creates a fixed grid definition. For responsive grids with repeat(auto-fit, minmax(...)), we recommend our advanced version (coming soon).
This generator creates a basic grid container. To create spanning items, you would need to add grid-column: span 2; etc. to individual items – easily done after copying the code.
CSS Grid is a two‑dimensional layout system that makes it easy to create complex, responsive layouts. Unlike Flexbox (one‑dimensional), Grid handles both columns and rows simultaneously, giving you total control over placement and alignment.
Perfect for page‑wide layouts, card grids, and dashboards.
Items can occupy the same cell for layered designs.
Combine with auto-fit/minmax for fluid layouts without media queries.
Tools to master CSS Grid