Flex grow
flex-grow property. It controls how a flex item will grow relative to other items when extra space is available in the container. | CSS Shortcut class | Applied style |
|---|---|
| |
| |
Examples
Grow
flex-grow
flex-grow class will expand to fill the available space, while the other two items maintain their natural size and won’t grow. 1
2
3
<div class="d-flex">
<p class="flex-none">1</p>
<p class="flex-grow">2</p>
<p class="flex-none">3</p>
</div> No grow
flex-grow-0
flex-grow-0 class won’t grow to fill the available space, while the other two items will expand to fill the remaining space. 1
2
3
<div class="d-flex">
<p class="flex-grow">1</p>
<p class="flex-grow-0">2</p>
<p class="flex-grow">3</p>
</div> xs:> 480pxsm:> 640pxmd:> 768pxlg:> 1024pxxl:> 1280px
<div class="xs:flex-grow ...">
...
</div>