CSS grid generator
Choose the number of columns, the gap and the container width. You get the exact column width and a grid rule you can paste into a stylesheet.
What you get
- Exact widths down to the pixel
- Modern CSS grid with minmax
- Copy the rule in one click
Questions
- Why minmax(0, 1fr) instead of 1fr?
- Plain 1fr lets long words push a column wider. minmax(0, 1fr) keeps all columns equal.
- Is a 12 column grid still useful?
- Yes, 12 divides by 2, 3, 4 and 6, so most layouts fit without fractions.
- Should the gap shrink on phones?
- Usually yes. A media query that halves the gap below 600 px keeps text from getting cramped.