Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS flex-grow property

CSS flex-grow property

CSS Reference Manual CSS Reference Manual

Example

Make the width of the second element three times that of the others:

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 »


Browser support

The numbers in the table indicate the version number of the first browser that supports this property.

The number immediately following -webkit-, -ms-, or -moz- is the first version that supports 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 grow factor of a flexbox.

**Note:** If the element is not a flexbox object, the flex-grow property has no effect.

Default value: 0
Inherited: No
Animatable: Yes. See Animatable. Try it
Version: CSS3
JavaScript syntax: object.style.flexGrow="5" Try it

CSS Syntax

flex-grow:

number

|initial|inherit;

Attribute values

Value Description
number A number that specifies how much the item will grow relative to the other flexible items. The default value is 0.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Related Articles

CSS Reference Manual:flex Property

CSS Reference Manual:flex-basis Property

CSS Reference Manual:flex-direction Property

CSS Reference Manual:flex-flow Property

CSS Reference Manual:flex-shrink Property

CSS Reference Manual:flex-wrap Property

CSS Reference Manual CSS Reference Manual