Converter Web ToolsConverter WebTools

CSS Grid Cheat Sheet

This CSS Grid cheat sheet lists the properties for two-dimensional grid layouts — defining columns and rows, gaps, and placing items.

Container

PropertyWhat it does
display: gridMake a grid container
grid-template-columns: 1fr 1frDefine columns
grid-template-rows: autoDefine rows
repeat(3, 1fr)Repeat columns/rows
minmax(100px, 1fr)Min/max track size
gap: 1remGap between cells
justify-items / align-itemsAlign items in cells

Items

PropertyWhat it does
grid-column: 1 / 3Span columns 1-2
grid-row: 1 / 3Span rows 1-2
grid-area: aPlace into a named area
justify-self / align-selfAlign one item

Related tools & charts