1. Pick a Preset or Customize Tracks
Load a Holy Grail, Dashboard, 12-Column, or Photo Gallery layout, then tweak column widths (240px, 1fr, 2fr), rows, and gutters live.
FREE ACCESSIBILITY & CSS GRID GENERATOR · TRACKS, AREAS & TAILWIND
Build responsive CSS Grid layouts visually in seconds. Customize columns, rows, gaps, track units, and named template areas, then copy clean Vanilla CSS, Tailwind classes, or standalone HTML.
.grid-container {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: repeat(3, minmax(40px, auto));
gap: 16px;
grid-template-areas:
"header header header"
"nav main aside"
"footer footer footer";
}
.item-header {
grid-column: span 3;
grid-area: header;
}
.item-nav {
grid-area: nav;
}
.item-main {
grid-area: main;
}
.item-aside {
grid-area: aside;
}
.item-footer {
grid-column: span 3;
grid-area: footer;
}
@media (max-width: 768px) {
.grid-container {
grid-template-columns: repeat(1, minmax(0, 1fr));
grid-template-areas: none;
}
.item-header, .item-nav, .item-main, .item-aside, .item-footer {
grid-column: span 1;
grid-row: span 1;
}
}HOW TO USE THIS CSS GRID BUILDER
Load a Holy Grail, Dashboard, 12-Column, or Photo Gallery layout, then tweak column widths (240px, 1fr, 2fr), rows, and gutters live.
Toggle the responsive @media query generator and click the Mobile tab to confirm your grid collapses cleanly on smaller screens.
Copy clean Vanilla CSS with minmax(0, 1fr) overflow protection, Tailwind utility classes, or a ready-to-open HTML demo file.
Use Flexbox when laying out items in a single direction (one row or one column, like a navbar or button group). Use CSS Grid when you need rows and columns aligned together—such as page shells, dashboards, bento grids, and photo galleries.
1fr stands for one fraction of the remaining free space in the grid container after fixed pixel tracks and gaps are subtracted. For example, 240px 1fr 2fr gives the sidebar 240px and splits the rest 1/3 and 2/3.
Named areas let you draw your layout in plain words (such as "header header" on row 1 and "sidebar main" on row 2). Every row must have the same number of columns, and each named area must form a single rectangle.
Yes. Enable "Generate Mobile @media Query", pick a breakpoint like 768px, and switch the live preview between Desktop and Mobile to inspect the stacked layout before copying the CSS.