CSS flex-shrink property
Let the second element shrink to one-third of the other elements:
Try it out . . .
Browser support
The numbers in the table support the version number of the first browser for this property.
The number immediately after -webkit-, -ms - or -moz - is the first version that supports the prefix property.
Property | |||||
---|---|---|---|---|---|
flex-shrink |
29.0
21.0 -webkit- |
11.0
10.0 -ms- |
28.0
18.0 -moz- |
9.0
6.1 -webkit- |
17.0 |
Definitions and usages
The flex-shrink property is used to set or retrieve the shrinkage ratio of the elastic box.
Note: If the element is not an element of an elastic box object, the flex-shrink property has no effect.
Default: | 1 |
---|---|
Inherited: | Whether |
Animated: | Is. S ee Animation . Give it a try |
Version: | CSS3 |
JavaScript syntax: | object .style.flexShrink="5" Give it a try |
CSS syntax
The property value
value | describe |
---|---|
number | A number, the specified item will shrink with other flexible projects.The default is 0. |
initial | Set this property for its default value.See initial 。 |
inherit | Inheriting this property from the parent element.See inherit 。 |
Related articles
CSS Reference Manual: flex attribute
CSS Reference Manual: flex-basis properties
CSS Reference Manual: flex-direction properties
CSS Reference Manual: flex-flow properties
CSS Reference Manual: flex-grow property
CSS Reference Manual: flex-wrap properties