Easy Tutorial
❮ Css3 Pr Flex Grow Sel Element Gt ❯

CSS flex-basis Property

CSS Reference Manual

Example

Set the initial length of the second flex item to 80 pixels:


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Numbers following -webkit-, -ms-, or -moz- indicate the first version that supported the prefixed property.

Property
flex-basis 29.0 <br>21.0 -webkit- 11.0 <br>10.0 -ms- 28.0 <br>18.0 -moz- 9.0 <br>6.1 -webkit- 17.0

Definition and Usage

The flex-basis property specifies the initial length of a flex item.

Note: If the element is not a flex item, the flex-basis property has no effect.

Default value: auto
Inherited: no
--- ---
Animatable: yes. See Animatable Try it
--- ---
Version: CSS3
--- ---
JavaScript syntax: object.style.flexBasis="200px" Try it
--- ---

CSS Syntax

Property Values

Value Description
number A length unit or a percentage, specifies the initial length of the flex item.
auto Default value. The length is equal to the length of the flex item. If the item has no specified length, the length will be according to its content.
initial Sets this property to its default value. See initial
inherit Inherits this property from its parent element. See inherit

Related Articles

CSS Reference Manual: flex Property

CSS Reference Manual: flex-direction Property

CSS Reference Manual: flex-flow Property

CSS Reference Manual: flex-grow Property

CSS Reference Manual: flex-shrink Property

CSS Reference Manual: flex-wrap Property

CSS Reference Manual

❮ Css3 Pr Flex Grow Sel Element Gt ❯