Lesson 7 of 18

⇄ CSS Flexbox

🎯 Grades 9–12 ⏱ ~40 minutes 🟡 Intermediate

What You'll Learn

  • How to activate Flexbox with display: flex
  • justify-content, align-items, flex-wrap, gap, and flex-direction
  • How to build navigation bars, card rows, and centered layouts
Quick Check

1. How do you activate Flexbox on a container?

Aflex: true;
Bdisplay: flex;
Clayout: flex;

2. Which property aligns items along the main axis (horizontal by default)?

Ajustify-content
Balign-items
Cflex-direction

3. Which value of justify-content puts equal space between items, with none at the edges?

Aspace-around
Bspace-between
Cspace-evenly

4. What does flex: 1 on an item do?

AMakes the item grow to fill available space
BSets the item width to 1px
CPuts the item first in the row