CSS Grid Generator
This tool builds a CSS grid layout from the number of columns and rows, their sizes and the gap. It shows a preview and writes the CSS and HTML to copy.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use CSS Grid Generator online
- Set columns and rows. Up to twelve of each.
- Pick the sizes and gap. Or auto-fit.
- Check the preview. And the HTML option.
- Copy the CSS. Paste it into your page.
Why use this free CSS Grid Generator
- Columns and rows
- Size choices
- Auto-fit option
- Row and column gap
- HTML for the cells
- Live preview
What CSS grid is
CSS grid lays out items in rows and columns. You declare the tracks on the container and the browser places the children in them. It suits page layouts, card lists and galleries, where flexbox, which works in one direction, is less natural. This tool writes the container rules so you do not have to remember the syntax.
Tracks and sizes
Choose how many columns and rows you want. Equal share, written 1fr, divides the free space evenly. Auto fits the content. A fixed size such as 100px stays the same. The minmax form lets a column shrink instead of overflowing. Auto-fit makes as many columns as fit, each at least 160px wide, which gives a layout that adapts to the screen without media queries.
Gap
The gap is the space between rows and columns, and does not add space at the outer edge. You can set one value for both, or give the column gap separately. Using gap instead of margins on each item keeps the spacing even and easy to change in one place.
The HTML
The tool can also write a container with one cell for every column and row, numbered, so that you can paste a working example and see the layout. Replace the cells with your own content. The class name is up to you, and the tool removes characters that are not allowed in a class name.
Limits of the preview
The preview draws equal cells for the number of columns and rows you picked. It does not show how auto and content-based sizes will change with real content, and for auto-fit it shows the column count you typed. Try the code in your page to see how it responds when the window is resized.
Using the tool
There is no button to wait for: the CSS Grid Generator result follows every change. Use result as input to pass the answer to the next step.
CSS Grid Generator: frequently asked questions
What does 1fr mean?
How do I make a responsive grid?
Can I set different gaps?
Does the CSS work in all browsers?
Can I name areas?
Is the CSS Grid Generator private?
Is there a way to reuse the CSS Grid Generator result?
Related searches for CSS Grid Generator
- CSS Grid Generator online
- free CSS Grid Generator
- CSS Grid Generator online free
- CSS Grid Generator for mobile
- CSS Grid Generator without sign up
- CSS Grid Generator – Developer & Web Tools
CSS Grid Generator is a free online tool on MAITBOX, in the Developer & Web Tools group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.