All Tools

CSS Grid Generator

Build CSS grid layouts visually — configure columns, rows, and gaps, then drag cells to create spanning grid items. The generated CSS uses grid-template-columns, grid-template-rows, and grid-column/grid-row shorthand for each item.

3
3
16px
16px

Column Widths

C1:
C2:
C3:

Row Heights

R1:
R2:
R3:

Preview (drag cells to create spans)

Click a span to remove it.

Generated CSS

Tips & tricks

  • Use fr units for flexible, proportional columns — 1fr 2fr gives a 1:2 ratio.
  • Drag across cells in the preview to create grid items that span multiple columns or rows.
  • Click a coloured span item in the preview to remove it.
  • auto columns size to their content; great for sidebars with fixed content.
  • Use column-gap and row-gap separately to control horizontal and vertical spacing.