Visually compose CSS Grid templates, gaps and placement, then copy the layout CSS.

Preview

Click a numbered item in the grid to select and reposition it.

grid-template-columns
grid-template-rows
Generated CSS
Columns
Rows
Gaps
16px
16px
Alignment
Grid items
Item 1
Presets

About CSS Grid Playground

The CSS Grid Playground composes real grid layouts visually. Add and remove column and row tracks to shape grid-template-columns and grid-template-rows, set the column and row gaps, and tune all four alignment properties — justify-items, align-items, justify-content and align-content — while the preview reflects every change instantly.

Item placement is where grids get powerful: add items, click one in the preview to select it, and position it with column start, column span, row start and row span. That is how sidebars, headers and feature cells span multiple tracks — the technique behind almost every real-world grid layout.

Three presets — holy grail, dashboard and gallery — load classic page structures you can dissect and adapt. When the layout is right, copy the generated CSS, containing the complete grid container rules and each item’s placement.

How to use CSS Grid Playground

  1. Add or remove column and row tracks to define the grid template.
  2. Set the column gap and row gap.
  3. Adjust the alignment controls: justify-items, align-items, justify-content and align-content.
  4. Add items, click one in the preview, and set its column/row start and span to place it.
  5. Load the holy grail, dashboard or gallery preset to study a classic layout.
  6. Copy the generated CSS into your stylesheet.

Frequently asked questions

justify-items aligns each item inside its own grid cell; justify-content aligns the whole grid inside the container when the tracks don’t fill it. The same distinction applies vertically with align-items versus align-content.

Select the item and increase its column span — the CSS output uses grid-column with a span value. Combined with a row span you can build header bars, sidebars and large feature cells within the same grid.

The classic page skeleton: full-width header and footer with three columns between them — navigation, main content and an aside. It was notoriously fiddly with floats; the preset shows how a few grid placements solve it cleanly.

Grid excels at two-dimensional layouts where rows and columns must align — page scaffolding, dashboards, galleries. Flexbox is best for one-dimensional flows like toolbars and menus. They combine well: grid for the page, flex inside components.

Yes, it is free and browser-based — experiment as long as you like, and nothing you build leaves your machine.


Popular searches
css grid generator css grid playground grid-template-columns generator css grid layout generator grid-template-areas builder css grid gap tool css grid visualizer
Need help?
Found an issue with this tool? Let our team know.
Report an issue

Add this free tool to your own website — copy and paste the code below.