What is the CSS flex-grow property?
The flex-grow property in
Note: There is no effect of this property on non-flexible items.
Syntax
flex-grow: number|initial|inherit;
Property values
-
Number: Its default value is 0. It is used to specify how much the flex item will grow. -
Initial: It sets the value to its default value. -
Inherit: It inherits the property from its parent value.
Code
The basic flex-grow property is as follows:
Explanation
In the above example, we apply the flex-grow property on Box 1 and Box 3, and the size is one; therefore, they are smaller in size. But the flex-grow property is set to be 5 and as a result, its size is more than the other two boxes. We can also set the values according to our choice.