Previous: HTML DOM Style opacity property
Next: HTML DOM Style outlineOffset property
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";
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.
Firefox, Opera and Chrome support order property.
Returns order attributes:
object .style.order
Set the order attributes:
object .style.order="number|initial|inherit"
值 | 描述 |
---|---|
number | 默认值是 0。规定灵活项目的顺序。 |
initial | 设置该属性为它的默认值。请参阅 initial 。 |
inherit | 从父元素继承该属性。请参阅 inherit 。 |