Latest web development tutorials

HTML DOM Style order property

Style Object Reference Style Objects

Examples

Flexible set the order of 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

order attribute specifies a flexible project with respect to the order of the same flexible container for other items.

Note: If theelement is not flexible project, the order property does not work.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Firefox, Opera and Chrome support order property.


grammar

Returns order attributes:

object .style.order

Set the order attributes:

object .style.order="number|initial|inherit"

Property Value

描述
number 默认值是 0。规定灵活项目的顺序。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: 0
return value: String representing the order attribute of the element.
CSS version CSS3


related articles

CSS Reference Manual: the Order property

HTML DOM STYLE Reference: alignContent property

HTML DOM STYLE Reference: alignItems property

HTML DOM STYLE Reference: alignSelf property

HTML DOM STYLE Reference: Flex Properties

HTML DOM STYLE Reference: flexBasis property

HTML DOM STYLE Reference: flexDirection 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


Style Object Reference Style Objects