flex-basis

W3C CSS Snapshot 2026

Set the starting size along the main axis before the item grows or shrinks.

On this page

Syntax and values

Value or syntaxWhat it does
autoInitial value. Uses width or height along the main axis, then falls back to content sizing if that size is auto.
contentStarts from the item’s intrinsic content size.
0 / 80px / 25%Sets a length or percentage. Percentages use the container’s inner main size and fall back to content if that size is indefinite.
min-content / max-content / fit-contentUses an intrinsic sizing keyword. Check support for advanced sizing functions in the formal syntax.

Try the example

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>flex-basis example</title>
  <style>
.layout { display: flex; width: min(100%, 320px); border: 2px solid teal; box-sizing: border-box; }
.layout > div { padding: 8px 12px; background: #def5f5; color: #123; border: 1px solid #81b9b5; box-sizing: border-box; }
.layout > div { flex: 0 0 54px; }
.layout .first { flex-basis: 110px; }
  </style>
</head>
<body>
<div class="layout">
  <div class="first">A</div>
  <div class="second">B</div>
  <div>C</div>
</div>
</body>
</html>

What to expect A starts wider than B and C. Try 25% in place of 110px.

Official references