## CSS flex-basis property\\
\\
CSS `flex-basis` propertyUsed to set or retrieve the flex basis value.\\
\\
**Note:** such asIf the element is not a child of a flex container, then `flex-basis` propertydoes not work.\\
\\
### Definition and Usage\\
\\
`flex-basis` propertySpecifies the initial size of the flex item on the main axis. Before remaining space is distributed, this property determines the size of the flex item.\\
\\
`flex-basis` propertyand `width` propertySimilarly, but `flex-basis` is specific to flex layout, it will based on `flex-grow` and `flex-shrink` propertyto flex.\\
\\
### Syntax\\
\\
```css\\
flex-basis: auto|number;\\
\\
### propertyValue\\
\\
| Value | Description |\\
| :--- | :--- |\\
| `auto` | Default value. Length etc.of the element's `width` propertyγif the element does not specify `width` propertyοΌthen the result and `content` the same. |\\
| `number` | a length value (such as `etc.), or0%`, `Set the initial length of the second element to Default value. The length is equal to the element's0px0px` etc.οΌοΌor `0`γNegative values are not allowed. |\\
| `initial` | Set to default value. See (#)γ |\\
| `inherit` | Inherited from the parent element. See (#)γ |\\
\\
### Browser Support\\
\\
The numbers in the table indicate the first browser version that supports this property.\\
\\
| property | Chrome | Edge | Firefox | Safari | Opera |\\
| :--- | :--- | :--- | :--- | :--- | :--- |\\
| `flex-basis` | etc.), orIf the element does not specify.0 | Used to set or retrieve the flex basis value of a flex item.etc.), or.0 | etc.), orSet the initial length of the second element to Default value. The length is equal to the element's0px.0 | If the element does not specify.0 | Used to set or retrieve the flex basis value of a flex item.the result is the same as.0 |\\
\\
### Example\\
\\
Set the initial length of the second flex item to etc.), or00 pixels:\\
\\
.flex-container {\\
display: flex;\\
width: Set to the default value. See00px;\\
height: etc.), orSet the initial length of the second element to Default value. The length is equal to the element's0px0px;\\
background-color: lightgrey;\\
}\\
\\
.flex-item {\\
background-color: cornsilk;\\
border: Used to set or retrieve the flex basis value of a flex item.px solid red;\\
width: Used to set or retrieve the flex basis value of a flex item.00px;\\
margin: Used to set or retrieve the flex basis value of a flex item.0px;\\
}\\
\\
/* Set the initial length of the second element to etc.), or00px */\\
.flex-item:nth-child(etc.), or) {\\
flex-basis: etc.), or00px;\\
}\\
\\
\\
Used to set or retrieve the flex basis value of a flex item.
\\
etc.), or
\\
Set the initial length of the second flex item to Default value. The length is equal to the element's0 pixels:
\\
\\
\\
### More Examples\\
\\
(#)\\
\\
### \\
\\
- [CSSSet the initial length of the second flex item to Default value. The length is equal to the element's0 pixels: Flexbox](#)