HTML & CSS · Junior · Question 27 of 75
Along which axis does justify-content align items in a flex container?
- 1Always horizontally, regardless of direction
- ✓Correct answer: Along the main axis, which is set by
flex-direction - 3Along the cross axis, perpendicular to
flex-direction
Explanation
justify-content works on the main axis, align-items on the cross axis. With flex-direction: row the main axis is horizontal; with column it's vertical, and justify-content aligns vertically. So "always horizontally" is wrong.