HTML & CSS · Flexbox · Lesson 10 of 25
Introducing Flexbox
Concept
Introducing Flexbox
Setting display: flex turns a container's children into a flexible row, or column, that is easy to align and space.
Once a container is flex, its direct children become "flex items" that automatically arrange themselves in a row by default, without needing floats or manual positioning.
- Explain the core idea behind Introducing Flexbox.
- Predict output before running a change.
- Test one realistic and one unusual input.
- Use the result to make the next decision.
- 1. Read one concept.
- 2. Change the example.
- 3. Run, compare, and explain.
- 4. Complete the challenge below.
Self-check before continuing
Without looking at the example, describe what changes when you modify one input in Introducing Flexbox. Then reopen the editor and prove your explanation with a small test.
You are ready to continue when you can predict, test, and explain the result.
Your turn
Put three boxes in a flex row with a 16px gap between them.
Ask about this lesson or your next move. The guide explains the path without taking the work away from you.
Ready for the next lesson?
Mark this lesson complete when you have finished the exercise.
Console