CSS flex-growProperty

CSS Reference


Example

Make the width of the second element three times that of the other elements:

div:nth-of-type(1) {flex-grow: 1;} div:nth-of-type(2) {flex-grow: 3;} div:nth-of-type(3) {flex-grow: 1;}

Try it Yourself »

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Numbers followed by -webkit-, -ms-, or -moz- specify the first version that worked with the prefixed 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

Definition and Usage

The flex-grow property is used to set or retrieve the expansion ratio of the flex container.

Note:If the element is not an item of a flex container, the flex-grow property has no effect.

Default value: 0
Inherited: no
Animatable: Yes. SeeAnimatable。 Try it Yourself
version: CSS3
JavaScript Syntax: object.style.flexGrow="5" Try it Yourself


CSS Syntax

flex-grow: number|initial|inherit;

Property value

Value Description
number A number that specifies the amount by which the item will grow relative to other flexible items. The default value is 0.
initial Set this property to its default value. Seeinitial。
inherit Inherited from the parent element. Seeinherit。


Related Articles

CSS Reference:flex property

CSS Reference:flex-basis property

CSS Reference:flex-direction property

CSS Reference:flex-flow property

CSS Reference:flex-shrink property

CSS Reference:flex-wrap property


CSS Reference

other extensions