flex-shrink in CSS Flexbox – How to Shrink Flex Item
flex-shrink tells browsers how much the specified flexible item should shrink when the sum of all items’ sizes exceeds the flexbox’s size.
In other words, suppose the flexbox’s size is insufficient to fit the flexible items. In that case, browsers will shrink the items to fit the container.
Therefore, flex-shrink
allows you to specify the shrinking factor of a flexible item.
Here’s an example:
We used the flex-shrink
property to prevent browsers from shrinking flex-item3
.