The justify-content
property defined item alignment along the main axis of a flex container, distributing any leftover space on the line and controling the alignment of overflowing items.
Not all browsers support all the possible values in the same way - documentation
Possible values:
flex-start
(default) - items grouped at the start of the flexboxflex-end
- items grouped at the end of the flexboxstart
- items grouped at the start ofwriting-mode
directionend
- items grouped at the end ofwriting-mode
directionleft
- items grouped to the left edge of the container, if conflicting withflex-direction
behaves likestart
\right
- items grouped to the right edge of the container, if conflicting withflex-direction
behaves likeend
center
- items are centredspace-between
- items are evenly distributed with first item on the start and last item on the endspace-around
- items are evenly distributed with equal space around each item (results in half space to the edges)space-evenly
- items are evenly spaced (between themselves and to the edges)
two additional keywords are safe
and unsafe
marking if an element can be pushed to render off-screen