flex-direction CSS property specifies how flex items are placed in the flex container, by setting the direction of the flex container's main axis.
The following table summarizes the usages context and the version history of this property.
|Applies to:||Flex containers|
|Animatable:||No. See animatable properties.|
|Version:||New in CSS3|
The syntax of the property is given with:
The example below shows the
flex-direction property in action.
ExampleTry this code »
/* Safari */
/* Standard syntax */
The following table describes the values of this property.
||The flex container's main-axis has the same orientation as the inline axis of the current writing mode i.e. text direction.|
||Same as row, but the start and end points of the axis are reversed.|
||The flex container's main axis to be the same orientation as the block axis (the vertical axis in horizontal writing modes and the horizontal axis in vertical writing modes) of the current text direction.|
||Same as column, but the start and end points of the axis are reversed.|
||Sets this property to its default value.|
||If specified, the associated element takes the computed value of its parent element
flex-direction property is supported in all major modern browsers.
See tutorial on: CSS3 Multi-column Layouts.