CSS Flexbox
Flexbox (Flexible Box Layout) is a CSS layout model that makes it easy to align and distribute space among items in a container — even when their sizes are unknown.
How to Enable
Add display: flex to a container. Its direct children become flex items.
Two Axes
- Main axis — Direction of item flow (horizontal by default)
- Cross axis — Perpendicular to main axis (vertical by default)
Flex Container vs Flex Items
Properties like justify-content, align-items, flex-direction go on the container. Properties like flex, align-self go on items.