Style flexBasisProperty
Example
Set the initial length of a flexible item to 200 pixels:
document.getElementById("myBlueDiv").style.flexBasis="200px";
Try it yourself »
Definition and Usage
The flexBasis property specifies the initial length of a flexible item.
Note:If the element is not a flexible item, the flexBasis property has no effect.
Browser Support
![]()
Firefox, Opera, and Chrome support the flexBasis property.
Syntax
Return the flexBasis property:
object.style.flexBasis
Set the flexBasis property:
object.style.flexBasis="number|auto|initial|inherit"
Property Values
| Value | Description |
|---|---|
| number | A length unit or a percentage, specifying the initial length of the flexible item. |
| auto | Default value. The length is equal to the length of the flexible item. If the item has no length specified, the length will be determined by its content. |
| initial | Sets this property to its default value. Seeinitial。 |
| inherit | Inherits this property from its parent element. Seeinherit。 |
Technical Details
| Default Value: | auto |
|---|---|
| Return Value: | A string, representing the element's flex-basis property. |
| CSS Version | CSS3 |
Related Articles
CSS Reference Manual:flex-basis property
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
Other Extensions
Style Object