CSS flex-direction Property

Set the direction of the flexible items inside the <div> element in reverse order:

div {
display: -webkit-flex; /* Safari */
-webkit-flex-direction: row-reverse; /* Safari 6.1+ */
display: flex;
flex-direction: row-reverse;
}

Try it Yourself »


Definition and Usage

The flex-direction property specifies the direction of the flexible items.

Note: If the element is not a flexible item, the flex-direction property has no effect.

Default value: row
Inherited: no
Animatable: no. Read about animatable
Version: CSS3
JavaScript syntax: object.style.flexDirection=”column-reverse” Try it
CSS Syntax
flex-direction: row|row-reverse|column|column-reverse|initial|inherit;
Property Values
Value Description
row Default value. The flexible items are displayed horizontally, as a row
row-reverse Same as row, but in reverse order
column The flexible items are displayed vertically, as a column
column-reverse Same as column, but in reverse order
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Post Author: Zahid Farid