CSS flex-grow Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The flex-grow property sets a flex item’s grow factor — how much of the container’s leftover main-axis space it should take compared with its siblings.

The initial value is 0 (do not grow). Use a non-negative number such as 1 or 2. It applies only to flex items inside a display: flex (or inline-flex) container. It is not inherited. For everyday layouts, MDN also recommends the flex shorthand, which sets grow, shrink, and basis together.

Baseline widely available.

Not deprecated. Prefer non-negative numbers. Negative values are invalid. Prefer flex: 1 (or similar) when you want the usual grow + shrink + basis combo in one line.

CSS Syntax

syntax.css
flex-grow: <number> | initial | inherit;

One non-negative number. Examples: 0, 1, 2, 0.5.

Property Values

ValueDescriptionTry it
0Do not grow. Initial valueTry it
1Take an equal share of free space (when siblings also use 1)Try it
2Take twice the free-space share of an item with 1Try it
<number>Any non-negative number used as a ratioTry it
initialResets to 0Try it
inheritInherits from the parent elementTry it

How to Use flex-grow

Make a flex row, then decide which children should absorb leftover width.

  1. Set the parent to display: flex.
  2. Leave room on the main axis (a wide container, or short content).
  3. Set flex-grow on items that should expand (1 is the usual equal share).
  4. Compare with flex-shrink and flex-basis, or use the flex shorthand.
PieceRequired?Role
Flex containerYesParent must be display: flex or inline-flex
Free spaceYes (to see growth)Container larger than the items’ base sizes
Grow factorYesRatio used when free space is split
flex-basis / contentMattersGrowth is added on top of the starting main size

Live Preview

Item A’s flex-grow changes. B and C stay at 1.

Higher factors give A a larger share of leftover width. All items start from a small base size.

Flex row

A flex-grow: 1

CSS Examples

Each snippet focuses on flex-grow. The parent is flex only so growth can show. Use Try It Yourself for a live editor.

Example 1 — Default Does Not Grow

With flex-grow: 0, items keep their content width.

CSS
<style>
  .row {
    display: flex;
  }

  .item {
    flex-grow: 0;
  }
</style>

<div class="row">
  <div class="item">A</div>
  <div class="item">B</div>
  <div class="item">C</div>
</div>
Try It Yourself

How It Works

  1. Create a flex row. display: flex turns children into flex items.
  2. Keep the default. flex-grow: 0 means leftover space stays empty (or follows alignment).
  3. Items stay compact. Each box is only as wide as its content needs.
  4. Baseline for comparison. Next examples turn growth on.

Example 2 — Equal Growth

Give every item flex-grow: 1 so they share free space evenly.

CSS
<style>
  .row {
    display: flex;
  }

  .item {
    flex-grow: 1;
  }
</style>

<div class="row">
  <div class="item">A</div>
  <div class="item">B</div>
  <div class="item">C</div>
</div>
Try It Yourself

How It Works

  1. Same factor on all. 1 + 1 + 1 means equal shares of free space.
  2. Leftover width is split. After base sizes, extra room is divided by the sum of factors.
  3. Common pattern. flex-grow: 1 (or flex: 1) fills a toolbar or card row.
  4. Any equal numbers work. All 2s behave like all 1s for the ratio.

Example 3 — Unequal Ratio

Let one item take twice the free-space share of another.

CSS
<style>
  .row {
    display: flex;
  }

  .a { flex-grow: 1; }
  .b { flex-grow: 2; }
</style>

<div class="row">
  <div class="a">A (1)</div>
  <div class="b">B (2)</div>
</div>
Try It Yourself

How It Works

  1. Sum the factors. 1 + 2 = 3 parts of free space.
  2. A gets one part. About one-third of the leftover width.
  3. B gets two parts. About two-thirds of the leftover width.
  4. Not double total width. Growth is only the extra space, added to each item’s base size.

Edge Cases & Pitfalls

If nothing grows, one of these is usually why.

parent

Needs a flex container

flex-grow on a block in a non-flex parent does nothing. Set display: flex on the parent first.

space

No free space, no growth

If items already fill the container (or wrap onto new lines with no leftover), grow factors have nothing to distribute.

ratio

Ratios, not percentages

2 is not “200% width.” It is twice the free-space share of 1.

minus

Negatives are invalid

flex-grow: -1 is dropped. Use 0 or a positive number.

shrink

Grow is not shrink

When space is tight, flex-shrink controls how items get smaller. Pair both via the flex shorthand when you can.

Browser Support

flex-grow is a browser CSS property for Flexbox. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

flex-grow

Supported in all modern browsers as part of CSS Flexible Box Layout (Baseline since September 2015).

100% Non-negative numbers
Google Chrome 29+
Full support
Mozilla Firefox 20+
Full support
Apple Safari 9+
Full support
Microsoft Edge 12+
Full support
Opera 17+
Full support
Samsung Internet All versions
Full support
Internet Explorer 11
Full support
flex-grow Widely supported

Bottom line: Safe for production Flexbox layouts. Prefer the flex shorthand for common grow + shrink + basis patterns. It is not a runtime API.

Key Takeaways

  • Role: decide how flex items share leftover main-axis space.
  • Initial value: 0. Not inherited.
  • Ratios: 1 and 2 split free space 1:2, not total width.
  • Tip: use the flex shorthand when you also care about shrink and basis.

One line: flex-grow is the ratio for sharing leftover flex space — 0 stays put, 1 shares equally.

Frequently Asked Questions

It sets how much leftover main-axis space a flex item should take relative to its siblings. Higher factors get a larger share of the free space.
The initial value is 0, so items do not grow and stay at their content or flex-basis size unless you change it.
It gets twice as much of the leftover free space, not twice the total width. Base sizes still matter.
No. It only applies to flex items. The parent needs display: flex or inline-flex.
MDN recommends the flex shorthand for common patterns, because it also sets flex-shrink and flex-basis reliably. flex-grow alone is fine for study and precise control.
It is Baseline and widely available in modern browsers. It is a browser CSS property, not a Node.js feature.

Next: flex-shrink

Learn how flex items give up space when the container is too small.

flex-shrink tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful