๐ŸŽจ CSS Tools

CSS Grid Generator

Define columns, rows, gaps and template areas visually. Generate production-ready CSS Grid code instantly.

Columns (grid-template-columns)
Rows (grid-template-rows)
Gap & Alignment
Layout Presets
๐Ÿ›๏ธ
Holy Grail
๐Ÿ“
12-Column
๐Ÿƒ
Card Grid
๐Ÿ“‹
Sidebar
๐Ÿ“ฐ
Magazine
๐Ÿ“Š
Dashboard
Live Preview
โœ“ Copied!

Related CSS Tools

Frequently Asked Questions

What is CSS Grid?

CSS Grid is a two-dimensional layout system for the web. It lets you arrange elements in rows and columns simultaneously, define named areas, control gaps, and align content โ€” all in CSS without JavaScript. It's ideal for page-level layouts and complex component arrangements.

What does fr mean in CSS Grid?

fr (fractional unit) represents a fraction of the available space in the grid container. For example, grid-template-columns: 1fr 2fr creates two columns where the second is twice as wide as the first. fr units only apply after fixed-size columns (px, rem, min-content) are accounted for.

What is repeat() in CSS Grid?

The repeat() function lets you repeat a track pattern. repeat(3, 1fr) is equivalent to 1fr 1fr 1fr. You can use repeat(auto-fill, minmax(200px, 1fr)) to create a responsive grid that automatically fills available space with as many columns as fit.

When should I use Grid vs Flexbox?

Use CSS Grid for two-dimensional layouts (rows and columns together, page layouts, complex grids). Use Flexbox for one-dimensional layouts (a row of buttons, a vertical nav list, centred content). They're complementary โ€” it's common to use Grid for the page structure and Flexbox inside grid cells.