Complete the Flex Centering
Fill in the Blank Easy
Question
Fill in the blank to center flex items vertically (cross axis in a row).
Code
.container {
display: flex;
flex-direction: row;
___: center;
}
Hint
justify-content handles the main axis; this handles the cross axis.
Explanation
align-items controls alignment along the cross axis (perpendicular to flex-direction). In a row layout, the cross axis is vertical, so align-items: center centers items vertically. justify-content would control horizontal alignment in a row.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.