Flex container properties define how child items are arranged, wrapped, and aligned.
Container controls
display: flexflex-directionflex-wrapjustify-content,align-items,align-content
Production checklist
- Use
gapfirst for spacing. - Enable wrap for unpredictable content lengths.
- Validate behavior with long labels and translations.
Important interview questions and answers
- Q: Why might align-content appear inactive?
A: It only affects multi-line flex containers. - Q: wrap vs nowrap?
A: Wrap allows new lines; nowrap forces single-line compression/overflow. - Q: Best property for item spacing?
A:gapon container.
Tip: Set display:flex on the parent; align/justify control children along axes.