Design modern, responsive web layouts with CSS Grid. Define columns, rows, gaps, and visualize the structure instantly. Generate production‑ready CSS code with explicit grid definitions.
1fr 2fr, repeat(3, minmax(100px, 1fr))).
-ms- prefixes. View full compatibility on caniuse.com
CSS Grid Layout is a two‑dimensional layout system for the web. Unlike Flexbox (one‑dimensional), Grid allows designers to control both columns and rows simultaneously, enabling complex responsive interfaces without hacks. This generator provides a visual playground to master grid-template-columns, grid-template-rows, gap, and alignment properties.
Imagine an analytics dashboard: a sidebar (250px), main content area (1fr), and a bottom stats bar that spans two columns. Using CSS Grid, you can define grid-template-columns: 250px 1fr; and grid-template-rows: auto 1fr auto; plus grid areas. This generator lets you prototype such structures before writing a single line of CSS. Many Fortune 500 dashboards leverage Grid for maintainable, resilient layout code.
1fr 2fr gives second column twice the space of the first.
repeat(3, 1fr) equals 1fr 1fr 1fr.
minmax(100px, 1fr) ensures minimum 100px, then grows proportionally.
"header header" "sidebar main".
200px 1fr 2fr grid-template-rowsDefines row heightsauto 120px minmax(100px, auto) gap / grid-gapRow and column gap shorthand1rem 24px justify-items / align-itemsAlign content within cells horizontally/verticallycenter, stretch
The repeat(auto-fit, minmax(200px, 1fr)) pattern creates flexible grid items that wrap gracefully. Auto‑fit expands items to fill the container, whereas auto‑fill preserves empty tracks. This is essential for responsive card layouts. Try our preset "Card Gallery" to see the effect: columns adjust based on container width, and items stretch without media queries.
minmax(0, 1fr) to prevent overflow.
repeat(auto-fit, minmax(minimum-size, 1fr)) pattern. This creates a fluid grid where items wrap automatically based on available space.