Build a CSS grid visually — set columns, rows and gaps, preview it live, and copy the CSS or Tailwind classes.
.grid-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(2, 120px);
column-gap: 16px;
row-gap: 16px;
}grid grid-cols-3 gap-x-[16px] gap-y-[16px]
CSS Grid is the layout system for two-dimensional layouts — rows and columns at the same time — and the fastest way to learn it is to change a value and watch the boxes move. This generator gives you column and row counts, per-axis gaps and track sizing, with a live preview above the generated code.
The important unit is fr, the fraction. repeat(3, 1fr) creates three equal columns that share the free space, which is what you want most of the time. Fixed units (px, rem) lock a track to a size, auto sizes it to its content, and minmax(200px, 1fr) gives a floor with flexibility above it. For responsive grids without media queries, try repeat(auto-fit, minmax(200px, 1fr)).
Copy the output as plain CSS for a stylesheet, or as Tailwind utility classes if you are working in a utility-first project. CSS Grid is supported by every current browser, so nothing here needs a fallback. The tool runs entirely in your browser.