Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. flex-grow

flex-grow

Specifies the grow factor of a flex item. Controls how much free space in the container each item receives when distributing the remaining space.

Sample Code

/* Do not grow (initial value) */
.item { flex-grow: 0;}

/* Distribute free space equally */
.item-grow { flex-grow: 1;}

/* Grow at twice the rate of other items */
.item-double { flex-grow: 2;}

Available Values

ValueDescription
<number>A number of 0 or greater. Initial value is '0' (no growth). Negative values are invalid.

Specification

ItemDetails
Initial value0
Applies toFlex items
InheritedNo
AnimationYes (interpolated as number)

Browser Compatibility

Chrome Chrome
29+
28
27
26
25
24
23
22
↑ Requires prefix '-webkit-'
21 or earlier ×
Firefox Firefox
20+
19 or earlier ×
Safari Safari
9+
8
7
↑ Requires prefix '-webkit-'
6 or earlier ×
Edge Edge
12+
Supported in all versions
IE IE
11
10
9 ×
8 ×
7 ×
6 ×
Opera Opera
12.1+
11 or earlier ×
iOS Safari iOS Safari
9+
8
7
↑ Requires prefix '-webkit-'
6 or earlier ×
Android Android Browser
4.4+
3 or earlier ×
Chrome Android Chrome Android
Latest
Same support as desktop version
Firefox Android Firefox Android
Latest
Same support as desktop version

※ Version data based on MDN / Can I Use.

Overview

'flex-grow' is a property applied to flex items that specifies how the remaining free space in the container is distributed among items. The initial value is '0', meaning items do not grow even if there is free space.

How Growth Works

flex-grow: 0 (default) — does not grow A B C ← space → All items flex-grow: 1 — grow equally A (1) B (1) C (1) A:1 B:1 C:2 — C gets twice the space

A (1) B (1) C (2) ← 2x

The 'flex-grow' value works as a ratio. If all items have 'flex-grow: 1', free space is distributed equally. If one item has 'flex-grow: 2', that item receives twice as much free space as others.

/* Container width: 600px, total item width: 300px → free space: 300px */

/* All items flex-grow: 1 → each gets 100px */
.item-a { flex-grow: 1;}  /* 100px + 100px = 200px */
.item-b { flex-grow: 1;}  /* 100px + 100px = 200px */
.item-c { flex-grow: 1;}  /* 100px + 100px = 200px */

/* item-b flex-grow: 2 → distributed in ratio 1:2:1 */
.item-a { flex-grow: 1;}  /* 100px + 75px = 175px */
.item-b { flex-grow: 2;}  /* 100px + 150px = 250px */
.item-c { flex-grow: 1;}  /* 100px + 75px = 175px */

Pattern 1: Fill the Remaining Space

Sidebar 250px flex-grow: 0 Main (all remaining) flex-grow: 1

/* Sidebar + main content layout */
.layout {
    display: flex;
}
.sidebar {
    width: 250px;     /* fixed width */
    flex-shrink: 0;   /* do not shrink */
}
.main {
    flex-grow: 1;     /* take all remaining space */
}

Pattern 2: Equal-Width Items

A grow:1 basis:0 B grow:1 basis:0 C grow:1 basis:0

/* Make all items the same width */
.equal-container {
    display: flex;
}
.equal-item {
    flex-grow: 1;
    flex-basis: 0;  /* start from 0 so space is distributed equally */
}

Difference Between 'flex-grow: 1' and 'width: 100%'

'flex-grow: 1' means "grow by distributing the container's free space", while 'width: 100%' means "expand to the full container width". They may look the same when there is only one item, but behave differently with multiple items. Use 'flex-grow' inside flex containers.

Related Properties

PropertyDescription
flex-shrinkSpecifies the shrink factor. 'flex-grow' is for distributing free space, 'flex-shrink' is for reducing size when space is insufficient.
flex-basisSpecifies the base size. The 'flex-grow' calculation applies to the free space remaining after the 'flex-basis' size.
flexShorthand for 'flex-grow', 'flex-shrink', and 'flex-basis'. Using 'flex' is recommended over specifying them individually.

If you find any errors or copyright issues, please .