Grid settings
Tweak the controls and watch the grid rebuild.
Learn CSS grid by playing with it. Adjust columns, rows, gaps and alignment, watch the live preview, and copy production-ready CSS. Free, instant, no sign-up.
Tweak the controls and watch the grid rebuild.
Set the number of columns and rows and the grid rebuilds with numbered demo cells. justify-items and align-items position content inside each cell; justify-content and align-content position the whole grid inside its container.
The code box always mirrors the preview, ready to copy.
Grid is two-dimensional: you control rows and columns together, which makes it ideal for page layouts, card galleries and dashboards. Flexbox is one-dimensional and better for rows or columns of items.
A common pattern: grid for the overall page structure, flexbox inside individual components.