CSS Grid Layout Generator (Visual Builder)
Visual builder for CSS Grid Layout. 6 presets (Holy Grail, Magazine, Auto-fit responsive…). Live preview + copy ready-to-use CSS.
fr = fraction. 1fr 2fr = 1:2 split. repeat(3, 1fr) = 3 equal columns. minmax(200px, 1fr) = at least 200px wide.
CSS Grid Layout — the modern standard for 2D UIs. Supported since 2017. Use fr for responsive, auto-fit/auto-fill for self-arranging grids.
CSS Grid vs Flexbox
- Flexbox: 1-dimensional — either row or column. Best for navbars, button lists, card rows.
- CSS Grid: 2-dimensional — rows + columns at once. Best for page layouts, dashboards, galleries, magazine layouts.
- Modern sites typically use BOTH: Grid for macro layout, Flexbox for micro components.
The fr unit (fraction)
fr = the remaining space after fixed sizes are subtracted:
1fr 1fr= 2 equal columns (50/50).1fr 2fr= 1:2 split (33%/67%).200px 1fr= 200px sidebar, main fills the rest.repeat(3, 1fr)= 3 equal columns (shortcut).repeat(auto-fit, minmax(200px, 1fr))= responsive — column count adapts to viewport.
6 common layouts
- 3 equal columns: feature grid, card row.
- Sidebar + Main: dashboard, docs site (240px sidebar nav, 1fr content).
- Holy Grail: header / sidebar-main-aside / footer — the classic web layout.
- Magazine (4 cols): blog index, news sites.
- Auto-fit responsive:
auto-fit + minmax— collapses from 4 → 2 → 1 column with viewport. - Masonry: Pinterest-style. Note:
grid-template-rows: masonryis Firefox-only for now; Chrome is in progress.
Tips
- gap >
margin: usegap: 16pxfor spacing between cells instead of margins on children. - grid-area: name areas for readability.
grid-template-areas: "header header" "sidebar main". - Responsive: prefer
auto-fit + minmaxover media queries for self-adapting grids.
Who this is for
Frontend devs, UI/UX designers, anyone prototyping visuals fast or generating CSS for Tailwind/React/Vue projects.
FAQ
Does the generated CSS work with Tailwind?
Yes. Output is vanilla CSS, paste into any .css file. For Tailwind projects, use @utilities layer or theme overrides.
Browser compatibility?
Modern CSS syntax (custom properties, grid). Works on Chrome/Firefox/Safari 2020+. IE11 NOT supported.
Related tools
See all tools →Color Picker
Pick HEX/RGB/HSL, RGB sliders, 12 presets, nearest Tailwind name.
NEWTailwind ↔ CSS Converter
Convert between Tailwind utility classes and vanilla CSS. ~200 utilities (spacing, color, flex, grid…). Helps migration.
NEWSVG to React/JSX
Convert SVG to React component. camelCase attrs, currentColor, TypeScript types, size/color props.
NEWCSS Animation Builder
Visual builder for CSS animations. 10 presets (fadeIn, bounce, pulse, spin, shake…). Tweak duration, easing, iteration.