Style flexBasis property
- Previous Page flex
- Next Page flexDirection
- Go to the Previous Level HTML DOM Style Object
Definition and Usage
flexBasis
This property specifies the initial length of the flexible item.
Note:If the element is not a flexible item, then flexBasis
Invalid property.
See also:
CSS Reference Manual:flex-basis property
Example
Set the initial length of the flexible item to 200 pixels:
document.getElementById("myBlueDiv").style.flexBasis = "200px";
Syntax
Return flexBasis property:
object.style.flexBasis
Set flexBasis property:
object.style.flexBasis = "number|auto|initial|inherit"
Property value
Value | Description |
---|---|
number | Specify the initial length of the flexible item, length unit, or percentage. |
auto |
Default value. The length is equal to the length of the flexible item. If the item does not specify a length, the length depends on its content. |
initial | Set this property to its default value. See initial. |
inherit | Inherit this property from its parent element. See inherit. |
Technical Details
Default value: | auto |
---|---|
Return value: | A string representing the element's flex-basis property. |
CSS Version: | CSS3 |
Browser Support
The numbers in the table indicate the first browser version to fully support this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 11.0 | Support | 9.0 | Support |
Related Pages
HTML DOM STYLE Reference Manual:flex property
HTML DOM STYLE Reference Manual:flexDirection property
HTML DOM STYLE Reference Manual:flexFlow property
HTML DOM STYLE Reference Manual:flexGrow property
HTML DOM STYLE Reference Manual:flexShrink property
HTML DOM STYLE Reference Manual:flexWrap property
- Previous Page flex
- Next Page flexDirection
- Go to the Previous Level HTML DOM Style Object