CSS: justify-content (flex, grid)
- This property is for the container of Flexbox or Grid layout.
- It specify how space is distributed for items along the flex flow direction or grid columns.
Position values
Positional alignment
justify-content: flex-start;-
default.
Aligns items to the start of the main axis. Ignores writing direction. Works only in Flexbox.
123 justify-content: flex-end;
justify-content: start;-
Aligns items to the start of the main axis. Respect writing direction. Works in both Flexbox and Grid.
justify-content: end;
justify-content: left;-
Forces alignment to the left side. Ignores writing direction. Only works in Flexbox, not in Grid.
justify-content: right;justify-content: center;-
123
Normal alignment
Distributed alignment
justify-content: space-between;-
123
justify-content: space-around;-
123
justify-content: space-evenly;-
123
Overflow alignment (for positional alignment only)
Overflow alignment (for positional alignment only)
justify-content: safe center;- xtodo
justify-content: unsafe center;- xtodo