Free APIs For You
Free APIs For You
Free · Browser-only · No sign-up

CSS Grid Generator

Build CSS grid layouts visually. Set template columns, rows, gap, and per-cell span properties with live preview. Includes presets for common layouts like Holy Grail, Sidebar, and Cards.

grid-template-columnsfr unitsCell spansPresetsAuto-fill100% offline
presets:

Container

16px
16px
16px
9
live preview — click a cell to select
1
2
3
4
5
6
7
8
9
css output
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 120px);
  column-gap: 16px;
  row-gap: 16px;
  padding: 16px;
}

Features

Template presets

Holy Grail, Sidebar, Equal 3, 2×2, 4 cols, and Cards presets to start fast

fr and repeat()

Supports the full grid-template syntax including fr units and repeat()

Cell overrides

Click any cell to set col-span, row-span, col-start, and row-start

Gap & padding

Independent column-gap, row-gap, and padding sliders

Item count

Control how many grid items appear in the preview (1–24)

Clean CSS output

Generated CSS is clean and copy-paste ready for any project

How to use

  1. 1

    Pick a preset

    Choose Holy Grail, Sidebar, Equal 3, or another preset to start with a working layout.

  2. 2

    Adjust columns and rows

    Edit the grid-template-columns and grid-template-rows fields with any valid CSS value.

  3. 3

    Set gap and padding

    Use the sliders to control column-gap, row-gap, and grid padding.

  4. 4

    Configure cells

    Click any cell in the preview and use the col-span, row-span, col-start, and row-start controls.

  5. 5

    Copy CSS

    Click Copy to grab the complete CSS and paste it into your stylesheet.

Frequently asked questions

Can I use minmax() in the template column input?

Yes. The column and row inputs accept any valid CSS grid template value, including repeat(), minmax(), auto-fill, auto-fit, fr units, px, em, %, and keyword values like auto.

How do I create a responsive grid that wraps automatically?

Use repeat(auto-fill, minmax(200px, 1fr)) in the grid-template-columns field. This creates as many columns as can fit, each at least 200px wide. No media queries needed — the grid reflows automatically.

What happens when I set grid-column-start?

grid-column-start places the item at a specific column line. Combined with col-span, you control exactly where in the grid the item starts and how wide it is.

Does this tool generate Tailwind grid classes?

This tool outputs vanilla CSS. Use the Tailwind Class Generator tool to build Tailwind grid classes like grid-cols-3 and gap-4.