About CSS Grid Generator
CSS Grid is a two-dimensional layout system: the container defines column and row tracks, and child elements fill the cells in order. This generator writes display: grid with grid-template-columns and grid-template-rows using repeat(), plus a gap, and previews the result with numbered cells. It covers evenly repeated tracks only. Named areas, mixed track sizes, and item placement with grid-column are left for you to add by hand.
How to use CSS Grid Generator
- Fill in "Columns", "Rows", "Column size" and "Row height", and the other options.
- The result appears below and updates as you type.
- Copy the result with the copy button, or download it as a file where that is offered.
Questions about CSS Grid Generator
What does the fr unit mean in CSS Grid?
One fr is one share of the free space left in the grid container after fixed tracks and gaps are subtracted. Three columns of 1fr each take a third of that space. A track of 2fr gets twice the share of a 1fr track.
Runs in your browser. Page last updated .