The flex-direction property sets how flex items are placed in a flex container. It defines the main axis and whether items run in the normal or reversed direction along that axis.
Use it on an element with display: flex or inline-flex. The initial value is row. It is not inherited. Pair it with flex-wrap using the flex-flow shorthand when you need both.
Baseline · Widely available.
Not deprecated and not experimental. Available across browsers since about September 2015.
Accessibility.
row-reverse and column-reverse change visual order only. DOM / tab / screen-reader order stay the same. Prefer changing HTML order when reading order matters.
With direction: rtl or dir="rtl", row runs right to left and row-reverse flips that again.
shorthand
Use flex-flow with wrap
flex-flow: column wrap sets direction and wrap together. A later shorthand can overwrite both.
Compatibility
Browser Support
flex-direction is a browser CSS property for flex containers. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
flex-direction
Supported in all modern browsers since about September 2015. Part of the CSS Flexible Box Layout module.
98%Flex support
Google Chrome29+
Full support
Mozilla Firefox20+
Full support
Apple Safari9+
Full support
Microsoft Edge12+
Full support
Opera17+
Full support
Samsung Internet2+
Full support
Internet Explorer11
Partial support
flex-directionWidely supported
Bottom line: Safe for production flex layouts. Watch accessibility when using reverse values. It is not a runtime API.
Remember
Key Takeaways
Role: choose the flex container’s main axis and direction.
Default:row — items follow the text direction.
Column: stacks items; grow, shrink, and basis apply vertically.
Reverse: visual flip only — keep DOM order sensible for accessibility.
One line:flex-direction picks the main axis — row sideways, column stacked, reverse only flips the view.
Frequently Asked Questions
It sets the main axis of a flex container and whether items run in the normal or reversed direction along that axis.
The initial value is row, which places items along the inline axis (left to right in left-to-right languages).
row lays items out horizontally along the text direction. column stacks them vertically along the block axis.
They flip the main-axis direction. Visual order changes, but DOM order stays the same — which can confuse keyboard and screen-reader users.
It changes which axis is the main axis. In a row, flex-basis is the starting width; in a column, it is the starting height.
It is Baseline and widely available in modern browsers since about September 2015. It is a browser CSS property for flex containers, not a Node.js feature.