flex アイテムのフロー方向。
名前 | flex-direction
|
---|---|
値 | row | row-reverse | column | column-reverse |
初期値 | row |
適用対象 | flex コンテナ |
継承 | されない |
百分率 | 受容しない |
算出値 | 指定されたキーワード |
正準的順序 | 文法に従う |
アニメーション型 | 離散的 |
flex-direction プロパティは、flex コンテナの主軸の方向を設定することにより、flex アイテムが flex コンテナの中で どのように配置されるかを指定する。これは、一連の flex アイテムがレイアウトされていく方向を決定する:
row
<DIV style="border:1px solid red; width:200px; height:170px; display:flex; flex-direction:row; "> <DIV style="flex-basis:50px; border:1px solid black">1</DIV> <DIV style="flex-basis:50px; border:1px solid black">2</DIV> <DIV style="flex-basis:50px; border:1px solid black">3</DIV> </DIV>
row-reverse
<DIV style="border:1px solid red; width:200px; height:170px; display:flex; flex-direction:row-reverse; "> <DIV style="flex-basis:50px; border:1px solid black">1</DIV> <DIV style="flex-basis:50px; border:1px solid black">2</DIV> <DIV style="flex-basis:50px; border:1px solid black">3</DIV> </DIV>
column
<DIV style="border:1px solid red; width:200px; height:170px; display:flex; flex-direction:column; "> <DIV style="flex-basis:50px; border:1px solid black">1</DIV> <DIV style="flex-basis:50px; border:1px solid black">2</DIV> <DIV style="flex-basis:50px; border:1px solid black">3</DIV> </DIV>
column-reverse
<DIV style="border:1px solid red; width:200px; height:170px; display:flex; flex-direction:column-reverse; "> <DIV style="flex-basis:50px; border:1px solid black">1</DIV> <DIV style="flex-basis:50px; border:1px solid black">2</DIV> <DIV style="flex-basis:50px; border:1px solid black">3</DIV> </DIV>
注記: row-reverse/column-reverse 値は、ボックスの順序付けを“逆順”にするものではない ─ writing-mode、direction プロパティ[CSS3-WRITING-MODES] と同様に、それらはフローの方向のみを変化させる。塗り、発話、逐次的ナビ の順序は影響されない。
表示内容: |
表示内容: |