CSS flex-basis property
Examples
Set the second element of the flexible pouch initial length is 80 pixels:
Browser Support
Figures in the table represent the first browser to support the property version number.
Immediately following the digital -webkit-, -ms- or -moz- after the first version to support the prefix property.
Attributes | |||||
---|---|---|---|---|---|
flex-basis | 29.0 21.0 -webkit- | 11.0 10.0 -ms- | 28.0 18.0 -moz- | 9.0 6.1 -webkit- | 17.0 |
Definition and Usage
flex-basis attribute is used to set or retrieve the flexible pouch stretching the reference value. .
Note: If theelement is not resilient element box object, the flex-basis property does not work.
Defaults: | auto |
---|---|
inherit: | no |
Can be animated: | Yes. Please refer to animation (Animatable) . try it |
version: | CSS3 |
JavaScript syntax: | object .style.flexBasis = "200px"try |
CSS Syntax
Property Value
值 | 描述 |
---|---|
number | 一个长度单位或者一个百分比,规定灵活项目的初始长度。 |
auto | 默认值。长度等于灵活项目的长度。如果该项目未指定长度,则长度将根据内容决定。 |
initial | 设置该属性为它的默认值。请参阅 initial 。 |
inherit | 从父元素继承该属性。请参阅 inherit 。 |
related articles
CSS Reference: Flex Properties
CSS Reference Manual: Flex-direction property
CSS Reference Manual: Flex-Flow Properties
CSS Reference Manual: Flex-Grow property
CSS Reference Manual: Flex-Shrink property
CSS Reference Manual: Flex-wrap property