← Lessons

📐 Flex Layout

Lesson 8 of 20
🎮
Themed Universe
Game Dev Lab
Arrange your game UI with Flexbox!
🎯 Missions
Try 3 different flex directions!
Use space-between alignment!
Solve all 4 challenges!
● ● ● style.cssCSS

  
previewLIVE
🎮 A
⚔️ B
🏆 C
💎 D

flex-direction

justify-content

align-items

flex-wrap

gap: 12px

Item A size: 80px

🎯 Challenge: Set flex-direction to "column" — use the dropdown!

Step 1 of 4

📐 Flex Layout

In Lesson 7 you learned that every element is a box. Now let's arrange boxes side by side (or top to bottom) using Flexbox — the most powerful layout tool in CSS! 🎮

↔️flex-direction — which way do items go? Row or column?
🎯justify-content — how items are spaced along the main line.
↕️align-items — how items line up on the cross axis.
📦gap — space between each item.