Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style flexBasis Property

Style flexBasis Property

Style Object Reference The Style object

Example

Sets the initial length of a flexible item to 200 pixels:

document.getElementById("myBlueDiv").style.flexBasis="200px";

Try it »


Definition and Usage

The flexBasis property specifies the initial length of a flexible item.

**Note:** The flexBasis property has no effect if the element is not a flexible item.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Firefox, Opera and Chrome support the flexBasis property.


Syntax

Returns the flexBasis property:

object

.style.flexBasis

Sets the flexBasis property:

object

.style.flexBasis="

number

|auto|initial|inherit"

Attribute values

Value Description
number A length unit or a percentage that specifies the initial length of a flexible item.
auto Default value. The length is equal to the length of the flexible item. If no length is specified for the item, the length is determined by its content.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: auto
Return Value: A string that represents the flex-basis property of an element.
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


Style Object Reference The Style object