Want to share your CSS expertise with others? Apply to the MDN Fellowship by April 1! http://mzl.la/MDNFellowship

mozilla

Revision 317101 of flex-grow

  • Revision slug: CSS/flex-grow
  • Revision title: flex-grow
  • Revision id: 317101
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

Summary

The flex-grow CSS property specifies the flex grow factor of a flex item.

  • {{ Xref_cssinitial() }}0
  • Applies to flex items
  • {{ Xref_cssinherited() }} no
  • Media {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }} as specified

See Using CSS flexible boxes for more properties and information.

Syntax

Formal syntax: <number>
flex-grow: value

Values

number
See {{ Xref_cssnumber() }}. Negative values are invalid.

Examples

element { 
  flex-grow: 3;
}

Specifications

Specification Status Comment
CSS Flexible Box Layout Module {{ Spec2('CSS3 Flexbox') }}  

Browser compatibility

Browser compatibility

{{ CompatibilityTable() }}

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support {{ CompatGeckoDesktop("18.0") }} (behind a pref) 21.0{{ property_prefix("-webkit") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
Feature Firefox Mobile (Gecko) Android IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

See also

Revision Source

<p>{{ CSSRef() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>flex-grow</code> <a href="/en/CSS" title="CSS">CSS</a> property specifies the flex grow factor of a flex item.</p>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}</dfn><code>0</code></li>
  <li><dfn>Applies to</dfn> flex items</li>
  <li><dfn>{{ Xref_cssinherited() }}</dfn> no</li>
  <li><dfn>Media</dfn> {{ Xref_cssvisual() }}</li>
  <li><dfn>{{ Xref_csscomputed() }}</dfn> as specified</li>
</ul>
<p>See&nbsp;<a href="/en/CSS/Using_CSS_flexible_boxes" title="/en/CSS/Using_CSS_flexible_boxes">Using CSS flexible boxes</a>&nbsp;for more properties and information.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
Formal syntax: &lt;number&gt;
</pre>
<pre>
flex-grow: <em>value</em>
</pre>
<h3 id="Values">Values</h3>
<dl>
  <dt>
    <code>number</code></dt>
  <dd>
    See {{ Xref_cssnumber() }}. Negative values are invalid.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre class="brush:css;highlight:[2]">
element { 
  flex-grow: 3;
}
</pre>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="external" href="http://dev.w3.org/csswg/css3-flexbox/#flex-grow" title="http://dev.w3.org/csswg/css3-flexbox/#flex-grow">CSS Flexible Box Layout Module</a></td>
      <td>{{ Spec2('CSS3 Flexbox') }}</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Firefox (Gecko)</th>
        <th>Chrome</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatGeckoDesktop("18.0") }} (behind a pref)</td>
        <td>21.0{{ property_prefix("-webkit") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>Android</th>
        <th>IE&nbsp;Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/CSS/Using_CSS_flexible_boxes" title="/en-US/docs/CSS/Using_CSS_flexible_boxes">Using CSS flexible boxes</a></li>
  <li>{{ CSS_Reference:FlexBox() }}</li>
</ul>
Revert to this revision