Flex direction
flex-direction property. It defines the main axis along which the flex items are placed. This determines if their layout direction is horizontal (row) or vertical (column). | CSS Shortcut class | Applied style |
|---|---|
| |
| |
| |
| |
Examples
Column
flex-col
1
2
3
<div class="d-flex flex-col">
<p>1</p>
<p>2</p>
<p>3</p>
</div> Reverse column
flex-col-reverse
1
2
3
<div class="d-flex flex-col-reverse">
<p>1</p>
<p>2</p>
<p>3</p>
</div> Row
flex-row
1
2
3
<div class="d-flex flex-row">
<p>1</p>
<p>2</p>
<p>3</p>
</div> Reverse row
flex-row-reverse
1
2
3
<div class="d-flex flex-row-reverse">
<p>1</p>
<p>2</p>
<p>3</p>
</div> xs:> 480pxsm:> 640pxmd:> 768pxlg:> 1024pxxl:> 1280px
<div class="xs:flex-col ...">
...
</div>