About CSS Grid Generator
Lay out a page or a component with CSS Grid without writing grid-template-areas by hand. Type the column and row sizes the way CSS takes them (1fr, 240px, auto, minmax(), repeat()), set the gaps, then drag across the cells to give a block of them an area name such as header or sidebar.
The preview is a real CSS grid drawn by your browser, so fr units, auto rows and gaps behave exactly as they will on your page. The CSS includes a rule per area, and the HTML has one element for each, ready to paste.
How it works
- Columns and rows are CSS track lists. The tool reads each size and counts the tracks, expanding repeat() with a fixed count.
- Each cell of the painter is one row and column of the grid. Dragging over cells fills that rectangle with the area name; erase mode empties it.
- CSS needs every area to be a rectangle. If painting cuts an area into another shape, that area is removed and the tool says so.
- The named areas are also written as text, one line per row, which you can edit directly. The page address keeps the whole layout, so a copied link reopens it.
Questions
Can I use repeat(auto-fill, …) or auto-fit?
Not here. Those make as many tracks as fit the page width, so there is no fixed set of cells to paint. Use a fixed count such as repeat(4, 1fr) to design the layout, then change it in your stylesheet.
How large a grid can I make?
Up to 12 columns and 12 rows, which covers page layouts and most component grids while keeping each cell large enough to tap.
Why did an area disappear when I painted?
An area in CSS Grid must be one rectangle. Painting through the middle of an area splits it, so the tool removes it rather than produce CSS a browser would ignore. Paint it again where you want it.
Can I use the keyboard instead of dragging?
Yes. Tab to a cell and press Enter to set one corner, then press Enter on the opposite corner to fill the rectangle. Escape cancels the first corner.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.