flex-basis

  • Revision slug: CSS/flex-basis
  • Revision title: flex-basis
  • Revision id: 7471
  • Created:
  • Creator: FredB
  • Is current revision? No
  • Comment one or more formatting changes

Revision Content

{{ CSSRef() }}

{{ SeeCompatTable() }}

Summary

The flex-basis CSS property specifies the flex basis which is the width based on which a flexbox item shrinks or flex according to the flexibility defined using flex-grow, flex-shrink or the shorthand property flex. <style type="text/css"></style>

  • {{ Xref_cssinitial() }}:auto
  • Applies to: flexbox items
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified

Syntax

Formal grammar: <'width'>

flex-basis: value

Values

'width'
All values accepted in width or height properties are accepted.

Examples

element { 
  flex-basis: 18em;
}

Specifications

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

Browser compatibility

{{ CompatibilityTable() }}

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Feature Firefox Mobile (Gecko) Android IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

See also

Revision Source

<p>{{ CSSRef() }}</p>
<p>{{ SeeCompatTable() }}</p>
<h2>Summary</h2>
<p>The <code>flex-basis</code> <a href="/en/CSS" title="CSS">CSS</a> property specifies the flex basis which is the width based on which a flexbox item shrinks or flex according to the flexibility defined using <code>flex-grow</code>, <code>flex-shrink</code> or the shorthand property <code>flex</code>.<nobr> <style type="text/css"><![CDATA[.cssprop {
  display:table;
  padding: 0.4em;
  border-left:0.15em solid;
  background-color:#eeeeff
}
.cssprop li {
 display:table-row;
 padding: 3px;
 margin:0;
}
.cssprop li dfn {
  display:table-cell;
  padding: 0 5px;
  border-bottom: none;
  cursor:inherit;
}




	
	
	]]></style> </nobr></p>
<nobr>
<ul class="cssprop"> <li><dfn>{{ Xref_cssinitial() }}:</dfn><code>auto</code></li> <li><dfn>Applies to:</dfn> flexbox 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>
</nobr>
<p><nobr></nobr></p><h2><nobr>Syntax</nobr></h2><nobr>
</nobr><pre class="twopartsyntaxbox"><nobr></nobr><nobr>Formal grammar: &lt;'width'&gt;
</nobr>
</pre>
<nobr> </nobr>
<pre><nobr>flex-basis: <em>value</em>
</nobr>
</pre>
<h3>Values</h3>
<dl> <dt><code>'width'</code></dt> <dd>All values accepted in <code>width</code> or <code>height</code> properties are accepted.</dd>
</dl>
<h2>Examples</h2>
<pre>element { 
  flex-basis: 18em;
}
</pre>
<h2 name="Specifications">Specifications</h2>
<table class="standard-table"> <thead> <tr style="background-color: rgb(255, 204, 255);"> <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-basis0" title="http://dev.w3.org/csswg/css3-flexbox/#flex-basis0">CSS Flexible Box Layout Module</a></td> <td>{{ Spec2('CSS3 Flexbox') }}</td> <td> </td> </tr> </tbody>
</table>
<h2>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>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</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 Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody> </table>
</div>
<h2>See also</h2>
<p><nobr></nobr></p>
Revert to this revision