CSS Grid Generator
Build two-dimensional CSS Grid layouts visually. Configure columns, rows, gaps, alignment and named areas — generate production-ready CSS, HTML and Tailwind instantly.
How to use
Start with a preset
Pick a ready-made layout (Dashboard, Holy Grail, Blog, Gallery, Bento) to see a real-world grid instantly. All controls update to match the preset — tweak from there or build from scratch.
Configure your grid
Set columns and rows with sliders, then fine-tune the column template (e.g. 1fr 3fr 1fr), row template, gaps and container width in the Grid Config tab. Switch to Alignment to control item and content distribution.
Use Named Areas or Cell Spans
Toggle Named Areas to open the visual text editor — type area names into cells to define grid-template-areas. Or click any cell in the preview to set grid-column and grid-row start/end spans.
Set responsive breakpoints
Go to the Responsive tab to configure how many columns to show at Desktop (>1024px), Tablet (≤1024px) and Mobile (≤768px). The Responsive output format generates ready-to-paste CSS with media queries.
Copy the format you need
Switch between CSS, HTML, Tailwind, CSS Variables and Responsive outputs. Copy any format individually or use the Quick Copy buttons to grab all formats at once.
Common CSS Grid layouts
Dashboard
A sidebar + main area layout with header and footer. Use the Dashboard preset with grid-template-areas for a clean, semantic two-dimensional layout that's easy to modify.
Holy Grail
The classic five-area layout: header across the top, navigation + main content + aside in the middle row, footer across the bottom. grid-template-areas makes this trivially readable.
Blog / Article
A three-column layout with a narrow sidebar, wide content area and ads column — using fractional units like 1fr 3fr 1fr to give the content most of the space.
Responsive Gallery
repeat(auto-fit, minmax(250px, 1fr)) creates a gallery that automatically adjusts column count based on available width — from 1 column on mobile to as many as fit on wide screens.
Bento Grid
Asymmetric feature grids where different cards span different numbers of columns and rows — used widely in product showcases and Apple-style marketing pages. Uses grid-column/row span.
Card grids
Equal-column card layouts with consistent gaps — the simplest use of CSS Grid. repeat(3, 1fr) with gap gives you a clean three-column card grid that degrades to two or one column with media queries.
How it works
Live CSS grid preview
The visual builder renders a real CSS grid using your exact configuration as inline styles. What you see in the preview is exactly what the CSS produces — not an approximation.
Named areas editor
The area editor is a grid of text inputs where each cell corresponds to a grid cell. Cells with matching names are colored identically, showing which cells share an area. The CSS grid-template-areas string is generated from the input values.
Cell span controls
Clicking a cell in the preview opens grid-column and grid-row start/end controls. The preview applies the span inline so you see the cell expand immediately. The spans are written as nth-child selectors in the CSS output.
Five output formats
The generator produces five ready-to-use formats: standard CSS, HTML structure (with semantic tags for named areas), Tailwind JIT classes, CSS custom properties, and a media-query responsive version with configurable breakpoints.
Related tools
Frequently asked questions
Quick answers about this free online tool.
