mozilla

Revision 290228 of flex-wrap

  • Revision slug: CSS/flex-wrap
  • Revision title: flex-wrap
  • Revision id: 290228
  • Created:
  • Creator: FredB
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

{{ SeeCompatTable() }}

Summary

The flex-wrap CSS property specifies whether the children are forced into a single line or if the items can be flowed on multiple lines.

  • {{ Xref_cssinitial() }}: {{ Cssxref("nowrap") }}
  • Applies to: flex containers/li>
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified

See Using CSS flexible boxes for more properties and information.

Syntax

Formal grammar: <flex-wrap>
                where <flex-wrap> is nowrap | wrap | wrap-reverse
flex-wrap: nowrap | wrap | wrap-reverse

Values

The following values are accepted:

nowrap
The flex items are laid out in a single line which may cause the flex container to overflow. The cross-start is either equivalent to start or before depending flex-direction value.
wrap
The flex items break into multiple lines. The cross-start is either equivalent to start or before depending flex-direction value and the cross-end is the opposite of the specified cross-start.
wrap-reverse
Behaves the same as wrap but cross-start and cross-end are permuted.

Examples

element { 
  flex-wrap: nowrap;
}

Specifications

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

Browser compatibility

{{ page("/en/CSS/Using_CSS_flexible_boxes", "Browser compatibility") }}

See also

Revision Source

<p>{{ CSSRef() }}</p>
<p>{{ SeeCompatTable() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>flex-wrap</code> <a href="/en/CSS" title="CSS">CSS</a> property specifies whether the children are forced into a single line or if the items can be flowed on multiple lines.</p>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}:</dfn> {{ Cssxref("nowrap") }}</li>
  <li><dfn>Applies to:</dfn> flex containers/li&gt;</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 <a href="/en/CSS/Using_CSS_flexible_boxes" title="/en/CSS/Using_CSS_flexible_boxes">Using CSS flexible boxes</a> for more properties and information.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox"><nobr>Formal grammar: &lt;flex-wrap&gt;
                where &lt;flex-wrap&gt; is nowrap | wrap | wrap-reverse
</nobr></pre>
<pre><nobr>flex-wrap: <em>nowrap | wrap | wrap-reverse</em>
</nobr></pre>
<h3 id="Values">Values</h3>
<p>The following values are accepted:</p>
<dl>
  <dt>
    <code>nowrap</code></dt>
  <dd>
    The flex items are laid out in a single line which may cause the flex container to overflow. The <strong>cross-start</strong> is either equivalent to <strong>start</strong> or <strong>before</strong> depending <code>flex-direction</code> value.</dd>
  <dt>
    <code>wrap</code></dt>
  <dd>
    The flex items break into multiple lines. The <strong>cross-start</strong> is either equivalent to <strong>start</strong> or <strong>before</strong> depending <code>flex-direction</code> value and the <strong>cross-end</strong> is the opposite of the specified <strong>cross-start</strong>.</dd>
  <dt>
    <code>wrap-reverse</code></dt>
  <dd>
    Behaves the same as <code>wrap</code> but <strong>cross-start</strong> and <strong>cross-end</strong> are permuted.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre><nobr>element { 
  flex-wrap: nowrap;
}
</nobr></pre>
<h2 id="Specifications" 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-wrap" title="http://dev.w3.org/csswg/css3-flexbox/#flex-wrap">CSS Flexible Box Layout Module</a></td>
      <td>{{ Spec2('CSS3 Flexbox') }}</td>
      <td> </td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ page("/en/CSS/Using_CSS_flexible_boxes", "Browser compatibility") }}</p>
<h2 id="See_also">See also</h2>
Revert to this revision