html69// dev utilities

CSS tool

CSS Grid Generator

Generate CSS Grid and Tailwind grid classes in one place. Columns, rows, gap, and span areas stay on your device.

Like the tool? Find a bug?Share with us

Generator

A CSS grid generator and Tailwind grid generator. Set columns, rows, and gap, then drag a span on the preview. CSS stays on your device.

Preview

11×1
2
3

Drag across cells to set a span area. Click a numbered box to select it.

Display

Justify

Align

Item 1

Supported files: .css
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid > :nth-child(1) {
  grid-column: 1 / span 1;
  grid-row: 1 / span 1;
}

.grid > :nth-child(2) {
  grid-column: 2 / span 1;
  grid-row: 1 / span 1;
}

.grid > :nth-child(3) {
  grid-column: 3 / span 1;
  grid-row: 1 / span 1;
}
grid grid-cols-3 grid-rows-2 gap-4
nth-child(2): col-start-2
nth-child(3): col-start-3
<div class="grid">
  <div>1</div>
  <div>2</div>
  <div>3</div>
</div>

Guide

How this CSS grid generator works

01

Tracks and gap

Columns and rows become repeat(n, minmax(0, 1fr)) and Tailwind grid-cols-* / grid-rows-*. Column gap and row gap map to gap or gap-x / gap-y.

02

Span areas

Drag across the preview to place a box. Column start, column span, row start, and row span write grid-column / grid-row and Tailwind col-span-* / row-span-*.

03

CSS, Tailwind, or HTML

Copy a .grid rule, Tailwind utilities, or the matching markup. Paste an existing grid declaration to reverse it onto the controls. Need one axis only? Use the CSS Flexbox Generator.

Use it

What to copy

Sample, Holy, Cards, Sidebar, and Feature are starting points. Use CSS in a stylesheet. Use the Tailwind grid generator output when the rest of the UI is utilities. Up to 12 columns, 12 rows, and 12 items.

FAQ

Questions

Grid or flexbox?

CSS Grid is two-dimensional: rows and columns together. Flexbox is one row or column that can wrap. This tool is a grid CSS generator. The flexbox generator is next to it.

Does this output Tailwind?

Yes. One click copies grid, grid-cols-*, gap-*, and span classes so it works as a Tailwind grid generator too.

Can I edit existing CSS?

Yes. Paste a display: grid block, including :nth-child() item rules. Tracks, gap, and spans map back onto the controls.

Is my CSS uploaded anywhere?

No. Preview, copy, and download run in this tab. There is no account and no API call. Paste is capped at 50,000 characters.