Flex wrap
flex-wrap property. It controls how flex items wrap onto multiple lines if there isn’t enough space for them. flex-direction property sets the main and cross axis. The effects of flex-wrap change based on the container's direction.| CSS Shortcut class | Applied style |
|---|---|
| |
| |
| |
Examples
Wrap
flex-wrap
In column layouts, it wraps from start to end horizontally.
1
2
3
<div class="d-flex flex-wrap">
<p>1</p>
<p>2</p>
<p>3</p>
</div> Reverse wrap
flex-wrap-reverse
In column layouts, it wraps from end to start horizontally.
1
2
3
<div class="d-flex flex-wrap-reverse">
<p>1</p>
<p>2</p>
<p>3</p>
</div> No wrap
flex-nowrap
1
2
3
<div class="d-flex flex-nowrap">
<p>1</p>
<p>2</p>
<p>3</p>
</div> xs:> 480pxsm:> 640pxmd:> 768pxlg:> 1024pxxl:> 1280px
<div class="xs:flex-wrap ...">
...
</div>