About the CSS Grid Generator
CSS Grid has completely transformed the way we design the web by giving us true two dimensional control. But coding a complex grid from scratch can sometimes be tiresome. You'll have to imagine the invisible rows and columns in your head while writing complicated CSS functions like repeat() and minmax().
This CSS grid generator removes the guesswork. It allows web developers and designers to build grid layouts visually. Watch your design take shape as you change properties and preview your CSS grid in real time. Then, click a button to copy all the CSS code you need to add the grid to a web page.
Key Features of CSS Grid Generator
- Interactive grid builderNo more imagining how your grid will look. See a preview of your layout and its colored blocks update in real time as you change properties.
- Advanced CSS Grid functionsAdd advanced CSS properties such as repeat(3, 1fr) in columns or minmax(80px, auto) in rows by simply using the dropdowns in the grid builder.
- Spacing and alignment controlsUse a slider to control spacing between items in your grid and dropdowns to adjust the default alignment of your grid items both horizontally and vertically.
- Fast and responsive layoutThe visual CSS grid builder works directly in your browser for faster results. There's no waiting around for pages to load as you fiddle with the sliders.
- Export CSS code with a click of a buttonWhen your layout looks the way you want it to, simply click "Copy CSS" to copy all the CSS code to your clipboard or "Download" to save the code as a file on your device.
How to Use CSS Grid Generator
- Define your grid structure by clicking on your desired values in the Columns (grid-template-columns) and Rows (grid-auto-rows) dropdown.
- Use the gap slider to set the amount of spacing between the items in your grid.
- Set default behavior of your grid items (vertically and horizontally) by using the dropdowns of: align-items, justify-items and for full control of the grid itself: justify-content.
- Look at a preview of your numbered and colored squares at the bottom of the page to see if it looks the way you want it to.
- Once you're satisfied, click the Copy CSS button to copy the code to your clipboard or Reset to start over
CSS Grid Generator Examples
A three-column grid with the default gap.
Default options
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: minmax(80px, auto);
gap: 12px;
justify-items: stretch;
align-items: stretch;
justify-content: stretch;
}