CSS
CSS Grid LayoutCSS Grid Layout
CSS Grid builds complex two-dimensional layouts easily.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
CSS Grid creates exact rows and columns for advanced page structures. While Flexbox handles single rows, Grid manages the entire page layout at once. Developers can precisely place elements into specific cells or stretch them across multiple tracks.
Syntax
Syntax
Example
Example
Key Points
- The `display: grid` property activates the layout mode.
- The `grid-template-columns` defines column widths.
- The `grid-template-rows` defines row heights.
- The `gap` property creates spacing between grid cells.