Build a CSS Grid layout
Start with a page layout, a card grid, or an empty grid. Set the number of columns and rows, then adjust the gaps between them. Under Track sizes, give each track its own width or height. For example, a 12rem sidebar alongside a 1fr content column leaves the remaining space for content.
Place items with named grid areas
Select an empty cell and then the opposite corner of the rectangle. Select the same cell twice to use a single cell. Select an existing area to rename or remove it. The generated CSS uses grid-template-areas on the container and grid-area on each item. Each name must occupy a rectangle, so a new area needs its own cells.
Copy CSS and HTML to your project
Copy the CSS to your stylesheet and the HTML to your page or component. The generated class names connect the elements to their areas. Replace the placeholder text with your own content. Use units such as fr, rem, and %, or a track like minmax(8rem, 1fr), to let the layout respond to its container.
Understand tracks and gaps
A track is the space taken by one row or column. An fr track gets a share of the remaining space, while auto can size a track to its content. A gap adds space between neighboring tracks. Use padding on the container when you need space around the entire grid.