CSS flex-direction property

CSS flex-direction property CSS reference manual


Set the direction of the elastic box element within the element in reverse order:

div
{
display:flex;
flex-direction:row-reverse;
}

Try it out . . .

Browser support

The numbers in the table support the version number of the first browser for this property.

The number immediately after -webkit-, -ms - or -moz - is the first version that supports the prefix property.

Property
flex-direction 29.0
21.0 -webkit-
11.0
10.0 -ms-
28.0
18.0 -moz-
9.0
6.1 -webkit-
17.0

Definitions and usages

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

Note: The flex-direction property does not work if the element is not an element of an elastic box object.

Default: row
Inherited: Whether
Animated: Whether. S ee Animation .
Version: CSS3
JavaScript syntax: object .style.flexDirection="column-reverse" Give it a try


CSS syntax

flex-direction: row|row-reverse|column|column-reverse|initial|inherit;

The property value

value describe Example
row Defaults.Flexible projects will be displayed horizontally, just as a row. try it "
row-reverse The same as ROW, but in the opposite order. try it "
column The flexible project will be displayed vertically, just as a column. try it "
column-reverse The same as Column, but in the opposite order. try it "
initial Set this property for its default value.See initial try it "
inherit Inheriting this property from the parent element.See inherit


Related articles

CSS Reference Manual: flex attribute

CSS Reference Manual: flex-basis properties

CSS Reference Manual: flex-flow properties

CSS Reference Manual: flex-grow property

CSS Reference Manual: flex-shrink properties

CSS Reference Manual: flex-wrap properties


CSS flex-direction property CSS reference manual