CSS flex-grow property
Make the second element three times wider than the other elements:
div:nth-of-type(2) {flex-grow: 3;}
div:nth-of-type(3) {flex-grow: 1;}
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-grow |
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-grow property is used to set or retrieve the extended ratio of the elastic box.
Note: If the element is not an element of an elastic box object, the flex-grow property has no effect.
Default: | 0 |
---|---|
Inherited: | Whether |
Animated: | Is. S ee Animation . Give it a try |
Version: | CSS3 |
JavaScript syntax: | object .style.flexGrow="5" Give it a try |
CSS syntax
The property value
value | describe |
---|---|
number | A number, the specified item will expand relative to 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-shrink properties
CSS Reference Manual: flex-wrap properties