CSS Flexbox Cheat Sheet
A quick reference for the most common Flexbox properties.
justify-content
Aligns items along the main axis (usually horizontal).
flex-startItems pack toward the start line.
flex-endItems pack toward the end line.
centerItems are centered along the line.
space-betweenItems are evenly distributed; first item is on the start line, last item on the end line.
space-aroundItems are evenly distributed with equal space around them.
space-evenlyItems are distributed so that the spacing between any two items (and the space to the edges) is equal.
align-items
Aligns items along the cross axis (usually vertical).
stretchStretch to fill the container (default).
flex-startItems are placed at the start of the cross axis.
flex-endItems are placed at the end of the cross axis.
centerItems are centered in the cross-axis.
baselineItems are aligned such as their baselines align.
flex-direction
Establishes the main-axis, defining the direction flex items are placed.
rowLeft to right (default).
row-reverseRight to left.
columnTop to bottom.
column-reverseBottom to top.
flex-wrap
By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed.
nowrapAll flex items will be on one line (default).
wrapFlex items will wrap onto multiple lines, from top to bottom.
wrap-reverseFlex items will wrap onto multiple lines from bottom to top.