CSS Grid Playground

Grandma Marni’s goods shelf, built by Mr. Karim, is a real grid: write the tracks, gap and auto-flow, and the browser resolves 1fr to px, shows where the…

Why it matters

Flexbox shines in 1 dimension. A page layout (full-width header, sidebar, content, footer) is 2-dimensional, and there Grid wins outright: grid-template-columns + grid-column make a page structure in about 5 lines of CSS.

The key idea

Grid is about lines, not cells

Common mistakes

Try it in this playground