CSS Grid
CSS Grid is a two-dimensional layout system — it handles both rows and columns simultaneously. Use Grid for page-level layouts, Flexbox for component-level layouts.
Enabling Grid
Set display: grid on the container. Then define columns and rows.
Grid vs Flexbox
| Grid | Flexbox |
|---|---|
| 2D (rows + cols) | 1D (one direction) |
| Layout-first | Content-first |
| Page/section layouts | Component alignment |