Example
Set the order of flexbox object elements:
- div#myRedDIV {order:2;}
- div#myBlueDIV {order:4;}
- div#myGreenDIV {order:3;}
- div#myPinkDIV {order:1;}
复制
Browser support
The numbers in the table represent the version number of the first browser to support the property.
The number immediately following -webkit-, -ms- or -moz- is the first version that supports the prefixed property.
Attributesorder | 29.0 21.0 -webkit- |
11.0 | 28.0 18.0 -moz- |
9.0 6.1 -webkit- |
17.0 |
Definition and Usage
The order property sets or retrieves the order in which the child elements of the flexbox model object appear. .
Note: The order property has no effect if the element is not an element of a flexbox object.
Default: Inherit: Animatable: Version: JavaScript Syntax:0 |
no |
Yes, see individual properties . See CSS3 Animation Properties , CSS3 Animation Examples . Effect preview |
CSS3 |
object .style.order="2" effect preview |
CSS syntax
order:
number|initial|inherit;
attribute value
Value descriptionnumber | The default value is 0. Specifies the order of flexible items. |
initial | Set this property to its default value. See initial . |
inherit | This property is inherited from the parent element. See inherit . |