Predict Flex Justify-Content
Predict Output Easy
Question
With flex-direction: row and justify-content: space-between, how are 3 items placed?
Code
.container {
display: flex;
justify-content: space-between;
}
/* 3 items inside */
Hint
space-between distributes equal space between items, not around them.
Explanation
justify-content: space-between places the first item at the start of the container, the last item at the end, and distributes the remaining space equally between items. With 3 items, the first is left, the last is right, and the middle one is centered with equal gaps on both sides.
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.