Rearrange the direction of the flexible items inside the <div> element:
The flexDirection property sets or returns the direction of the flexible items.
Note: If the element is not a flexible item, the flexDirection property has no effect.
The flexDirection property is supported in IE10+, Firefox, Opera, and Chrome.
Note: Safari 6.1+ supports an alternative, the WebkitFlexDirection property.
Return the flexDirection property:
Set the flexDirection property:
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 |
Default Value: | row |
---|---|
Return Value: | A String, representing the flex-direction property of an element |
CSS Version | CSS3 |
CSS reference: flex-direction property
HTML DOM STYLE Reference: flex property
HTML DOM STYLE Reference: flexBasis property
HTML DOM STYLE Reference: flexFlow property
HTML DOM STYLE Reference: flexGrow property
HTML DOM STYLE Reference: flexShrink property
HTML DOM STYLE Reference: flexWrap property