スタイル注文プロパティ
例
フレキシブルアイテムの順序を設定します。
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プロパティは、同じコンテナ内の残りのフレキシブルアイテムに対するフレキシブルアイテムの順序を指定します。
注:要素がフレキシブルアイテムでない場合、orderプロパティは効果がありません。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
order | Yes | 12.0 | Yes | Yes | Yes |
構文
注文プロパティを返します。
object.style.order
注文プロパティを設定します。
object.style.order = "number|initial|inherit"
プロパティ値
Value | Description |
---|---|
number | Default value 0. Specifies the order for the flexible item |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | 0 |
---|---|
戻り値: | 要素のorderプロパティを表す文字列 |
CSSバージョン | CSS3 |
関連ページ
CSSリファレンス:注文プロパティ
HTML DOM STYLEリファレンス:alignContentプロパティ
HTML DOM STYLEリファレンス:alignItemsプロパティ
HTML DOM STYLEリファレンス:alignSelfプロパティ
HTML DOM STYLEリファレンス:flexプロパティ
HTML DOM STYLEリファレンス:flexBasisプロパティ
HTML DOM STYLEリファレンス:flexDirectionプロパティ
HTML DOM STYLEリファレンス:flexFlowプロパティ
HTML DOM STYLEリファレンス:flexGrowプロパティ
HTML DOM STYLEリファレンス:flexShrinkプロパティ
HTML DOM STYLEリファレンス:flexWrapプロパティ
❮スタイルオブジェクト