フレキシブル・アイテムの順序を設定します:
/* Code for Safari 6.1 to 8.0 */
div#myRedDIV {-webkit-order: 2;}
div#myBlueDIV {-webkit-order: 4;}
div#myGreenDIV {-webkit-order: 3;}
div#myPinkDIV {-webkit-order: 1;}
/* Standard syntax */
div#myRedDIV {order: 2;}
div#myBlueDIV {order: 4;}
div#myGreenDIV
{order: 3;}
div#myPinkDIV {order: 1;}
Try it Yourself ❯
order プロパティは、同じコンテナ内の他のアイテム対するフレキシブル・アイテムの順序を指定します。
注: 要素がフレックスアイテムでない場合、order プロパティの効果はありません。
| デフォルト値: | 0 |
|---|---|
| 継承: | 継承する |
| アニメーション可否: | yes, 個別のプロパティを参照してください. animatable を参照 Try it |
| バージョン: | CSS3 |
| JavaScript 構文: | object.style.order="2" Try it |
表中の数字は、完全にプロパティをサポートした最初のブラウザのバージョンです。
-webkit-、-moz- の後に続く数字 は、接頭辞付きで動作した最初のバージョンです。
| プロパティ | |||||
|---|---|---|---|---|---|
| order | 29.0 21.0 -webkit- |
11.0 | 28.0 18.0 -moz- |
9.0 6.1 -webkit- |
17.0 |
order: number|initial|inherit;
| 値 | 説明 |
|---|---|
| number | デフォルト値は 0 です。フレキシブル・アイテムの順序を指定します |
| initial | プロパティにデフォルト値を設定します。initial を参照 |
| inherit | このプロパティは親要素を継承します。inherit を参照 |
CSSリファレンス:flex プロパティ
CSSリファレンス:flex-basis プロパティ
CSSリファレンス:flex-direction プロパティ
CSSリファレンス:flex-flow プロパティ
CSSリファレンス:flex-grow プロパティ
CSSリファレンス:flex-shrink プロパティ
CSSリファレンス:flex-wrap プロパティ
CSSリファレンス:align-content プロパティ
CSSリファレンス:align-items プロパティ
CSSリファレンス:align-self プロパティ
HTML DOM リファレンス:order プロパティ