CSS Grid reference
CSS Grid is a two-dimensional layout system: you define rows and columns on a container, then place items into the resulting cells or named areas. This reference covers every standard grid property in both groups — track definition, the implicit grid, gaps, alignment, and item placement — with accepted values, defaults, and short descriptions, plus live search.
How it works
A grid begins with display: grid on the container. grid-template-columns, grid-template-rows, and grid-template-areas define the explicit grid; grid-auto-rows, grid-auto-columns, and grid-auto-flow govern the implicit tracks created for overflowing items. Alignment uses two axes: justify-* on the inline axis and align-* on the block axis, with -items aligning cell content and -content distributing the tracks. Item placement uses line numbers, named lines, or area names via grid-column, grid-row, and grid-area. The filter matches names, values, and descriptions.
Tips and example
A classic responsive grid with no media queries:
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1rem;
}
repeat(auto-fit, minmax(220px, 1fr))makes columns that grow to fill the row and wrap when they would get narrower than 220px.- Name regions with
grid-template-areasand assign them withgrid-areafor highly readable layouts. gapreplaces the old grid-gap / grid-row-gap / grid-column-gap names, which are still supported as aliases.