flex-grow

W3C CSS Snapshot 2026

Set how much an item takes from positive free space. The factor is a ratio, not a width.

On this page

Syntax and values

Value or syntaxWhat it does
0The initial value. The item does not grow.
1Takes an equal share when other items also have a factor of 1.
2 / 0.5Any nonnegative number is accepted. A factor of 2 requests twice the free space of a factor of 1 under typical equal constraints.

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-grow 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-basis: 44px; flex-grow: 1; }
.layout .first { flex-grow: 2; }
  </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 gains twice the extra width of either neighbor. Its total width also includes the starting size.

Official references