Justify Content

Align items along the main axis.

The justifyContent property aligns Flexbox items along the main axis (horizontal if flexDirection is Row; vertical if Column). In Grid, it aligns the column tracks along the inline axis. The property is initially undefined; Flexbox uses flex-start alignment by default.

Values

ValueDescription
FlexStartDefault. Items pack toward the start of the line.
Start / EndAlign to the logical start/end edge, independent of a reversed flex direction.
StretchStretch auto-sized Grid tracks; in Flexbox this behaves as flex-start.
FlexEndItems pack toward the end of the line.
CenterItems are centered along the line.
SpaceBetweenItems are evenly distributed. First item at start, last item at end.
SpaceAroundItems are evenly distributed with equal space around them.
SpaceEvenlyItems are evenly distributed with equal space between any two items (and edges).

SafeStart, SafeEnd, SafeFlexStart, SafeFlexEnd, and SafeCenter fall back to start alignment when the requested alignment would overflow before the start edge.

Example

Loading Preview…

API Reference

Next Steps

© 2026 ByteLand Technology Limited