Flexbox and Grid solve different layout problems. Flexbox arranges items along a single axis — useful for navigation rows, button groups, and toolbars. Grid defines both rows and columns at once, making it the right tool for card galleries and full-page regions.

What this covers

  • display: flex and gap for row-based layouts that can wrap
  • display: grid with repeat() and minmax() for responsive column tracks
  • When to reach for each system

Flexbox and Grid layout specimen

Preview