CSS Grid Layout
The king of 2D layouts. Coordinate rows and columns simultaneously with the revolutionary fr unit, minmax(), and the magic responsive one-liner.
When to Use Flexbox vs When to Use Grid
Use Flexbox when you want items to sit in a single row or column, and let the content size dictate where each item lands.
Best for: Navbars, button groups, modal footers, tag lists.
Use Grid when you have both horizontal columns and vertical rows that must line up strictly like a spreadsheet.
Best for: Full page layouts, dashboard bento grids, card directories.
`repeat(auto-fit, minmax(250px, 1fr))`
The single most famous CSS Grid snippet. It creates a completely responsive grid of cards with zero media queries:
Adjust Columns & Fr Track Sizing
Interactive Grid Visualizer
Advanced CSS Grid Studio
Experiment with 2D fractional tracks, auto-fit/auto-fill, dense packing, item column/row spanning, and line number coordinates.
Click any block to adjust its grid-column and grid-row spanning.
12. CSS Subgrid
Align nested card titles, buttons, and content directly to parent grid rows.