Picture a flex container as a path for its child elements, called flex items. The main axis runs in the direction those items travel. Set `display: flex` on the container, then use `flex-direction` to choose the path. The cross axis runs perpendicular to it. section 12.2
The direction changes which way the main axis points:
- `row` runs horizontally from left to right and is the default; `row-reverse` runs from right to left. section 12.2
- `column` runs vertically from top to bottom; `column-reverse` runs in the opposite direction. section 12.2
body {
display: flex;
flex-direction: column;
justify-content: flex-start;
max-width: 50em;
min-height: 100vh;
}
Here, the `body` is a flex container. `flex-direction: column` gives it a vertical main axis, and `justify-content: flex-start` places its items at the start of that axis—the top of the page. section 12.11
Why choose a direction? A page can stack its major parts along a vertical main axis while using horizontal flex containers for a header, navigation bar, and content columns. A photo-gallery layout likewise uses a single-column `body` to start its items at the top. Try changing a container between `row` and `column`: which way do its items run now? section 12.11 section 15.11


