CSS Grid Generator

Interactive CSS Grid builder with live preview and CSS output.

Runs entirely in your browser
1
2
3
4
5
6
  • 1
  • 2
  • 3
  • 1
  • 2
8px
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 100px 100px;
gap: 8px;

FAQ

What does 1fr mean?
One fraction of the remaining free space after fixed tracks are subtracted. Two 1fr columns each take half the leftover width; a 2fr + 1fr split gives you a 2:1 ratio.
When should I use auto instead of fr?
auto sizes a track to fit its content. Use it for menus or labels of unpredictable length; use fr for the flexible content next to them.

Related tools