Header
column 1 / span 3 · row 1 / span 1
A CSS Grid playground is an interactive visual editor that lets you define rows, columns, spacing, and item placement while seeing the layout update instantly. This free CSS grid generator helps kids and beginners learn CSS Grid with real layouts instead of abstract syntax alone.
Want more than a grid layout tool? Explore the full Zap Code builder to turn layouts into real apps and games.
What this tool includes
Preset grid templates
Start from holy grail, sidebar, or gallery layouts before making them your own.
Drag and resize tiles
Move items visually across the stage and change how many tracks each tile spans.
Live code output
Copy the generated CSS as the grid-template and placement rules update in real time.
Adjust track definitions, drag items to new cells, resize spans, and keep the preview plus generated CSS in sync while you learn.
Preset Layouts
Each preset starts with sensible tracks and item placements so you can reverse-engineer real layouts before customizing them.
Grid Properties
Grid becomes easier to understand when you can compare track sizing with item placement in the same screen.
Examples: 220px minmax(0, 1fr) 180px or repeat(4, minmax(0, 1fr))
Examples: 96px minmax(220px, 1fr) 88px or repeat(3, 120px)
This becomes more visible when the grid has extra room around its tracks.
Grid Items
Drag items in the preview on desktop or mobile, then fine-tune the row and column values here if you want exact control.
Header
column 1 / span 3 · row 1 / span 1
Navigation
column 1 / span 1 · row 2 / span 1
Main story
column 2 / span 1 · row 2 / span 1
Sidebar
column 3 / span 1 · row 2 / span 1
Footer
column 1 / span 3 · row 3 / span 1
Load the holy grail, sidebar, or gallery template to begin from a practical layout instead of a blank canvas.
Change grid-template-columns, grid-template-rows, gap, and alignment settings to understand how the full container behaves.
Move items around the stage and use the resize handle to change how many rows or columns each item covers.
The CSS updates live as you edit the layout, so you can paste the working grid rules directly into a project or lesson.
Common questions about Grid tracks, spacing, placement, and how Grid compares with Flexbox.
A CSS Grid playground is an interactive visual editor where you adjust grid container properties and move items around a layout to see the result immediately. It makes CSS Grid easier to learn because rows, columns, spacing, and placement update in real time.
grid-template-columns defines the size and number of columns in the grid. You can mix fixed values like 200px with flexible tracks like 1fr or patterns such as repeat(4, minmax(0, 1fr)) to create responsive layouts.
Use CSS Grid when you need two-dimensional layout control across rows and columns at the same time. Flexbox is usually better for one-dimensional alignment such as navbars, button groups, or simple horizontal and vertical stacks.
gap controls the spacing between tracks, while align-items, justify-items, align-content, and justify-content control how items and the whole grid sit inside the available space. Testing them together is one of the fastest ways to understand how Grid distributes content.
Yes. A visual CSS Grid editor helps beginners connect the code to the layout they see on screen, which makes concepts like spans, track sizing, and placement much easier to remember than reading syntax alone.
Compare Grid with Flexbox, test motion, and then head back to Zap Code to build a full project from the layout you just sketched.
Compare grid layouts with one-dimensional Flexbox alignment and sizing in a matching live playground.
Open toolOnce the layout is set, test keyframes, transitions, and motion details in Zap Code's animation tool.
Open toolPair layout experiments with stronger color choices, palette building, and quick HEX, RGB, and HSL copying.
Open tool