CSS flex-basis property
Set the initial length of the second elastic box element to 80 pixels:
Try it out . . .
Browser support
The numbers in the table support the version number of the first browser for this property.
The number immediately after -webkit-, -ms - or -moz - is the first version that supports the prefix property.
Property | |||||
---|---|---|---|---|---|
flex-basis |
29.0
21.0 -webkit- |
11.0
10.0 -ms- |
28.0
18.0 -moz- |
9.0
6.1 -webkit- |
17.0 |
Definitions and usages
The flex-basis property is used to set or retrieve elastic box scaling reference values.
Note: If the element is not an element of an elastic box object, the flex-basis property has no effect.
Default: | auto |
---|---|
Inherited: | Whether |
Animated: | Is. S ee Animation . Give it a try |
Version: | CSS3 |
JavaScript syntax: | object .style.flexBasis="200px" Give it a try |
CSS syntax
The property value
value | describe |
---|---|
number | A length unit or a percentage, which specifies the initial length of the flexible project. |
auto | Defaults.Length is equal to the length of the flexible project.If the item is not specified, the length will be determined according to the content. |
initial | Set this property for its default value.See initial 。 |
inherit | Inheriting this property from the parent element.See inherit 。 |
Related articles
CSS Reference Manual: flex attribute
CSS Reference Manual: flex-direction properties
CSS Reference Manual: flex-flow properties
CSS Reference Manual: flex-grow property
CSS Reference Manual: flex-shrink properties
CSS Reference Manual: flex-wrap properties