The flex-shrink property specifies how much the item will shrink compared to others item inside that container. It defines the ability of an element to shrink in compared to the other elements which are placed inside the same container.
Note: If the item in the container is not flexible item then flex-shrink property will not affect that item.
flex-shrink: number| initial| inherit;
- number: A number that defines how the item will shrink compare to other flexible items.
- initial: It sets the value to it’s default value.
- inherit: It inherit the property from it’s parent elements.
Example: Here we are going to see in a single container there are 5 div, we will apply the flex-shrink on 2nd div and that div will shrink compared to other 4 div’s. We can apply flex-shrink on any document in the same container and that div will shrink compared to other div’s width, flex-shrink will shrink that div compared to other items in that container.
Supported Browser: The browser supported by CSS | flex-shrink Property are listed below:
- Google Chrome 29.0
- Internet Explorer 11.0
- Mozila Firefox 28.0
- Opera 17.0
- Safari 9.0
- HTML | DOM Style flexShrink Property
- CSS | transition-property Property
- CSS | all Property
- CSS | top Property
- CSS | right Property
- CSS | animation-name Property
- CSS | height Property
- HTML | DOM name Property
- CSS | padding-right Property
- CSS | order property
- CSS | padding-top Property
- CSS | visibility Property
- HTML | DOM Bdo dir Property
- CSS | The object-fit Property
- CSS | columns Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.