CSS Grid Generator
Build grid layouts with custom tracks, spanning items and named areas, then copy CSS, HTML or Tailwind.
How to use
- Set 1–12 columns and rows, then enter one size per track. Fixed-count repeat() expands into tracks; minmax() sets a minimum and maximum.
- Adjust gaps and item alignment. Select an item and enter its start and end lines; the end line is exclusive.
- Enable named areas for non-overlapping rectangles, or keep numeric placement for intentional overlap.
- Copy CSS with the HTML skeleton, or enable Tailwind HTML. Preview dimensions and decorative styles are not exported.
FAQ
How do I make a grid item span multiple columns or rows?
Set the start and end grid lines. Column start 1 and end 3 spans two columns; row start 1 and end 2 spans one row. For N tracks, the final line is N + 1.
Can I use repeat(), minmax() and named grid areas?
Yes. Fixed integer repeat() groups expand to at most 12 tracks per axis. minmax() accepts fr only as its maximum. Each named area belongs to one non-overlapping rectangle. Auto-fit, auto-fill, nested repeat(), calc() and CSS variables are not supported.
Why do grid items overlap or overflow the preview?
Numeric placements may share cells; the generator reports overlapping pairs. Named-area mode rejects overlap. Fixed pixel tracks and percentage tracks plus gaps can exceed the container size. The preview scrolls rather than silently changing your CSS.
How is this different from the other CSS generators?
This tool generates two-dimensional layout and item placement. The related gradient and box-shadow tools generate decorative effects instead. Layout input stays in memory; only display options are saved between visits.