Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style order Property

Style order Property

Style Object Reference The Style object

Example

Set the order of the flexible items:

document.getElementById("myRedDIV").style.order = "4";

document.getElementById("myBlueDIV").style.order = "3";

document.getElementById("myGreenDIV").style.order = "1";

document.getElementById("myPinkDIV").style.order = "2";

Try it »


Definition and Usage

The order property specifies the order of a flexible item relative to the other flexible items in the same container.

**Note:** If the element is not a flexible item, the order property has no effect.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Firefox, Opera, and Chrome support the order property.


Syntax

Return the order property:

object

.style.order

Set the order property:

object

.style.order="

number

|initial|inherit"

Attribute values

Value Description
number The default value is 0. Specifies the order of the flexible item.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: 0
Return Value: A string representing the element's order property.
CSS version CSS3

Related Articles

CSS Reference Manual:order property

HTML DOM STYLE Reference Manual:alignContent Property

HTML DOM STYLE Reference Manual:alignItems Property

HTML DOM STYLE Reference Manual:alignSelf Property

HTML DOM STYLE Reference Manual:flex Property

HTML DOM STYLE Reference Manual:flexBasis Property

HTML DOM STYLE Reference Manual:flexDirection Property

HTML DOM STYLE Reference Manual:flexFlow Property

HTML DOM STYLE Reference Manual:flexGrow Property

HTML DOM STYLE Reference Manual:flexShrink Property

HTML DOM STYLE Reference Manual:flexWrap Property


Style Object Reference The Style object