Align Content

Control alignment of lines in multi-line flex containers.

The alignContent property aligns a flex container's lines when there is extra space on the cross axis. It has no effect on a single-line flex container (flexWrap: FlexWrap.NoWrap). It also aligns Grid rows and content within Block and FlowRoot containers along the block axis.

The property is initially undefined, which leaves alignment to the layout algorithm. In Flexbox, the default behavior stretches wrapping lines.

Values

ValueDescription
StretchLines stretch to take up the remaining space.
Start / EndContent aligns to the logical start/end edge.
FlexStartLines packed to the start of the container.
FlexEndLines packed to the end of the container.
CenterLines packed to the center of the container.
SpaceBetweenLines evenly distributed; the first line is at the start, the last line at the end.
SpaceAroundLines evenly distributed with equal space around them.
SpaceEvenlyEqual spacing between lines and at both edges.

SafeStart, SafeEnd, SafeFlexStart, SafeFlexEnd, and SafeCenter fall back to start alignment when content would overflow before the start edge. Block content is aligned as one group; the distribution values do not space individual block children apart.

Example

Loading Preview…

Next Steps

© 2026 ByteLand Technology Limited