Definition
The flex-basis
CSS property is used in flexbox layouts to define the initial size of a flex item along the main axis before any remaining space is distributed. It specifies the ideal size of the item, taking into account the available space and other factors like flex-grow
and flex-shrink
. The flex-basis
property can be set to a specific length value (e.g., 200px
), a percentage (e.g., 50%
), or the auto
keyword.
For example, flex-basis: 300px;
would set the initial width of a flex item to 300 pixels.