The flex-basis property sets the initial main size of a flex item — before flex-grow and flex-shrink share free or overflow space.
In a row flex container it is the starting width. In a column container it is the starting height. The initial value is auto. It applies only to flex items and is not inherited.
Baseline · Widely available.
Not deprecated and not experimental. Available across browsers since about September 2015.
Shorthand tip.
For everyday layouts, prefer the flex shorthand (flex: 1, flex: auto). It sets grow, shrink, and basis together. Use flex-basis alone when you only need to change the starting size.
Start from zero.flex-basis: 0 ignores content width as the starting size.
Grow the same amount. Each item has flex-grow: 1, so free space is split evenly.
Result. The three columns end up the same width even with different text lengths.
Same idea as flex: 1. The shorthand usually expands to grow 1, shrink 1, basis 0% (or similar).
Edge Cases & Pitfalls
If sizes look wrong, check whether basis, width, or grow/shrink is winning.
flex item
Only works on flex items
The parent needs display: flex or inline-flex. On a normal block, flex-basis has no effect.
width
Non-auto basis beats width
In a row container, a length or percent flex-basis overrides width for the main size. With auto, width is used.
0 vs 0%
0 and 0% are not always identical
A length 0 is absolute. A percent needs a definite container main size; otherwise it can resolve like content sizing (especially in column layouts).
min-size
Content can still block shrinking
Even with a small basis, the automatic minimum size can keep an item from shrinking below its content. Use min-width: 0 when overflow is expected.
shorthand
Setting flex resets basis
A later flex shorthand overwrites grow, shrink, and basis together. Put longhand flex-basis after the shorthand if you need both.
Compatibility
Browser Support
flex-basis is a browser CSS property for flex items. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
flex-basis
Supported in all modern browsers since about September 2015. Part of the CSS Flexible Box Layout module.
98%Flex support
Google Chrome29+
Full support
Mozilla Firefox22+
Full support
Apple Safari9+
Full support
Microsoft Edge12+
Full support
Opera17+
Full support
Samsung Internet2+
Full support
Internet Explorer11
Partial support
flex-basisWidely supported
Bottom line: Safe for production flex layouts. Prefer the flex shorthand for common patterns. It is not a runtime API.
Remember
Key Takeaways
Role: set the initial main size of a flex item before grow and shrink.
Default:auto — follow width/height or content.
Equal columns:flex-basis: 0 with matching flex-grow values.
Everyday tip: prefer flex: 1 / flex: auto unless you need basis alone.
One line:flex-basis is the starting main size — then grow and shrink finish the layout.
Frequently Asked Questions
It sets the initial main size of a flex item before flex-grow and flex-shrink share free or overflow space. In a row container that is the starting width; in a column container it is the starting height.
The initial value is auto. The browser uses the item's width or height when set, or sizes from content when those are also auto.
On a flex item, a non-auto flex-basis sets the main-size start and wins over width in a row flex container. When flex-basis is auto, width (or height in a column) is used instead.
The item starts from zero main size before growing. With flex-grow: 1 on siblings, this is a common way to make equal-width columns that ignore content width.
MDN recommends the flex shorthand (for example flex: 1 or flex: auto) for everyday layouts, because it sets grow, shrink, and basis together. Use flex-basis alone when you only need to change the starting size.
It is Baseline and widely available in modern browsers since about 2015. It is a browser CSS property for flex items, not a Node.js feature.