Visual CSS Grid layout builder with live preview. Define columns and rows using fr, px, auto, or minmax units. Configure gap, justify-items, and align-items. See your grid update in real time and copy production-ready CSS code instantly.
Add and remove columns and rows with individual size controls. Choose from fr (fraction), px (pixels), auto, or minmax units for each track. Build any grid structure you need.
Watch your grid layout update in real time as you change settings. Colored cells fill the grid with labels so you can see exactly how your layout behaves at a glance.
Start from common layout patterns: Holy Grail, Sidebar, Photo Gallery, Dashboard, 3 Equal Columns, or Responsive Cards. Customize any preset to fit your design.
Get clean, copy-paste-ready CSS for your grid container. One click copies the code to your clipboard. Includes grid-template-columns, grid-template-rows, gap, and alignment properties.
CSS Grid is a two-dimensional layout system that gives you complete control over rows and columns simultaneously. It was designed specifically for layout, unlike older techniques that repurposed floats or tables. With CSS Grid, you define a grid structure on the container and place items into specific cells or let them auto-flow.
grid-template-columns and grid-template-rows define the sizes of each column and row in your grid. Tracks can use fixed units (px), flexible fractions (fr), auto sizing, percentages, or the minmax() function. The fr unit is particularly powerful -- it distributes remaining space proportionally, making responsive layouts effortless.
The gap property (also known as grid-gap) controls the spacing between grid tracks. You can set separate values for column-gap and row-gap, or a single value for both. Gap only affects spacing between tracks, not between items and the container edge. This makes it more predictable than margins.
justify-items aligns grid items along the inline (row) axis within their cells. align-items aligns items along the block (column) axis. The default value 'stretch' fills the entire cell. Other values (start, center, end) position items within their cells without stretching.
Check out our other free CSS tools. Generate flexbox layouts, gradients, box shadows, and more -- all from your browser with no sign-up required.
CSS Flexbox Generator →