Adapted from: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
On the container set the display property to flex and set the flex direction:
.container {
display: flex;
flex-direction: row | row-reverse | column | column-reverse;
}
row and row reverse are left to right and right to left. Column and column reverse are up to down and down to up.
In the items within the container do the following:
.item {
order: <integer>;
}
This will indicate which items should come first in the box.