StyleflexBasis Property
Example
Set the initial length of a flex-item to 200 pixels:
Description
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
| Property | |||||
|---|---|---|---|---|---|
| flexBasis | Yes | 11.0 | Yes | 9.0 | Yes |
Syntax
Return the flexBasis property:
Set the flexBasis property:
Property Values
| Value | Description |
|---|---|
| number | A length unit, or percentage, specifying the initial length of the flexible item(s) |
| 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 according to its content |
| initial | Sets this property to its default value.Read aboutinitial |
| inherit | Inherits this property from its parent element.Read aboutinherit |
Technical Details
| Default Value: | auto |
|---|---|
| Return Value: | A String, representing the flex-basis property of an element |
| CSS Version | CSS3 |
Related Pages
CSS reference:flex-basis property
HTML DOM STYLE Reference:flex property
HTML DOM STYLE Reference:flexDirection property
HTML DOM STYLE Reference:flexFlow property
HTML DOM STYLE Reference:flexGrow property
HTML DOM STYLE Reference:flexShrink property
HTML DOM STYLE Reference:flexWrap property

