CSS Grid generator
Set columns, rows and gaps with sliders and see the result live. Copy the CSS and HTML ready to paste into your project.
Processed 100% in your browser
CSS
HTML
Ctrl + Enter runCtrl + C copy result
How to use
- 1Adjust the number of columns and rows.
- 2Set the gap between columns and rows.
- 3Choose the column width: equal, fixed, auto or responsive.
- 4Copy the generated CSS and HTML.
Use cases
- Build a card gallery that adapts to screen width.
- Set up the skeleton of a dashboard.
- Learn how grid-template-columns and gap work.
- Prototype layouts quickly before coding.
Frequently asked questions
What is CSS Grid?
A two-dimensional CSS layout system that arranges elements in rows and columns.
What does auto-fit with minmax do?
It creates as many columns as fit at a minimum width and stretches them to fill the space: ideal for responsive layouts without media queries.
What does 1fr mean?
A fraction of the available space. Three 1fr columns split the width equally.
Does it work in all browsers?
Yes, CSS Grid is supported by all modern browsers.