flex-shrink

christian.dinh2481 total contributions
Published Jul 23, 2021Updated Sep 3, 2021
Contribute to Docs
The flex-shrink
property specifies how much space an item may be scaled down relative to the other items in the container (when items in the flex container are larger than the space available). An item assigned a flex-shrink
value of 2, will be scaled twice as much as an item assigned a value of 1.
Syntax
#element-container {display: flex;flex-shrink: <flex-value>;}
The <flex-value>
should be an integer or decimal value. The default value is one; therefore, initially all elements in a container will be scaled by the same factor in order to meet the space available.
Example 1
An image that will not scale down given flex-shrink conditions:
#img-one {display: flex;flex-shrink: 0;}
All contributors
- christian.dinh2481 total contributions
- Anonymous contributorAnonymous contributor3077 total contributions
- Anonymous contributorAnonymous contributor88 total contributions
- christian.dinh
- Anonymous contributor
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.