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