Style flexGrow Property
Example
Let the blue DIV element grow five times wider than the rest of the flexible items:
document.getElementById("myBlueDiv").style.flexGrow = "5";
Try it Yourself »
Description
The flexGrow property specifies how much the item will grow relative to the rest of the flexible items inside the same container.
Note: If the element is not a flexible item, the flexGrow property has no effect.
Browser Support
Property | |||||
---|---|---|---|---|---|
flexGrow | Yes | 11.0 | Yes | 9.0 | Yes |
Syntax
Return the flexGrow property:
object.style.flexGrow
Set the flexGrow property:
object.style.flexGrow = "number|initial|inherit"
Property Values
Value | Description |
---|---|
number | A number specifying how much the item will grow relative to the rest of the flexible items. Default value is 0 |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Technical Details
Default Value: | 0 |
---|---|
Return Value: | A String, representing the flex-grow property of an element |
CSS Version | CSS3 |
Related Pages
CSS reference: flex-grow property
HTML DOM STYLE Reference: flex property
HTML DOM STYLE Reference: flexBasis property
HTML DOM STYLE Reference: flexDirection property
HTML DOM STYLE Reference: flexFlow property
HTML DOM STYLE Reference: flexShrink property
HTML DOM STYLE Reference: flexWrap property
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.