HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Set the initial length of the second flex-item to 100 pixels
The flex-basis
property specifies the initial length of a flexible item.
flex-basis
property has no effect.
Default value: | auto |
---|---|
Inherited: | no |
Animatable: | yes. Read about animatable Try it |
Version: | CSS3 |
JavaScript syntax: | object.style.flexBasis="200px" Try it |
The numbers in the table specify the first browser version that fully supports the property.
Numbers followed by -webkit- or -moz- specify the first version that worked with a prefix.
Property | |||||
---|---|---|---|---|---|
flex-basis | 29.0 21.0 -webkit- |
11.0 | 28.0 18.0 -moz- |
9.0 6.1 -webkit- |
17.0 |
Value | Description | Play it |
---|---|---|
number | A length unit, or percentage, specifying the initial length of the flexible item(s) | Demo ❯ |
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 | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
CSS Tutorial: CSS Flexible Box
CSS Reference: flex property
CSS Reference: flex-direction property
CSS Reference: flex-flow property
CSS Reference: flex-grow property
CSS Reference: flex-shrink property
CSS Reference: flex-wrap property
HTML DOM reference: flexBasis property