Flex Container Display
Predict Output Easy
Question
What layout do the items adopt?
Code
.container {
display: flex;
flex-direction: row;
}
/* Items are laid out... */
Hint
flex-direction: row is the default.
Explanation
display: flex with flex-direction: row (the default) lays out child elements in a horizontal row. Items shrink and grow according to their flex properties. Without flex, block elements would stack vertically. Flexbox is ideal for one-dimensional layouts (either a row or a column).
Related Resources
Related Lessons
- CSS Flexbox
Learn Flexbox layout.
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.