Set the initial length of the second flex-item to 100 pixels:
div:nth-of-type(2) {
-webkit-flex-basis: 100px; /* Safari 6.1+ */
flex-basis: 100px;
}
Definition and Usage
The flex-basis property specifies the initial length of a flexible item.
Note: If the element is not a flexible item, the 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 |
CSS Syntax
flex-basis: number|auto|initial|inherit;
Property Values
| Value | Description |
|---|---|
| number | A length unit, or percentage, specifying the initial length of the flexible item(s) |
| 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 |
| initial | Sets this property to its default value. Read about initial |
| inherit | Inherits this property from its parent element. Read about inherit |
