Skip to content
CSS Grid Generator

CSS Grid Generator

v1.2

Compose grid templates visually — set your tracks, drag across the preview to paint named areas, and copy the generated CSS. Everything updates live.

Runs locally — nothing leaves your browser.

Presets
Columns
Rows
Gap · column
Gap · row

Paint your first area — drag across cells, or use the arrow keys and Enter.

Drag across cells to paint an area. Grab an area's right or bottom edge to resize, or drag the line between two tracks to resize them. On the keyboard: focus a cell and press Enter on two opposite corners; focus a painted area (Tab to its name) then use arrows to move and Shift+arrows to resize. Overlapping an area replaces it.

Alignment
justify-items

Inline-axis position of each item in its cell.

align-items

Block-axis position of each item in its cell.

justify-content

How the column tracks are distributed.

align-content

How the row tracks are distributed.

Areas

No areas yet — paint one on the grid.

Laying out a single row or column? Try Flexbox Playground