flex-wrap

  • Revision slug: CSS/flex-wrap
  • Revision title: flex-wrap
  • Revision id: 4082
  • Created:
  • Creator: FredB
  • Is current revision? No
  • Comment 14 words added, 815 words removed

Revision Content

{{ CSSRef() }}

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. <style type="text/css"></style>

  • {{ Xref_cssinitial() }}: {{ Cssxref("nowrap") }}
  • Applies to: flexboxes
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified

Syntax

Formal grammar: <flex-wrap>{1} 
                where <border-style> is nowrap | wrap | wrap-reverse

flex-direction: nowrap | wrap | wrap-reverse

Values

The following values are accepted:
nowrap The flexbox items are laid out in a single line which may cause the flexbox to overflow. The "cross-start" is either equivalent to "start" or "before" depending flex-direction value
wrap The flexbox 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

{{ 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>
<h2>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. <nobr> &lt;style type="text/css"&gt;<!--[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;
}

	
	]]-->&lt;/style&gt; </nobr></p>
<ul class="cssprop"><nobr> <li><dfn>{{ Xref_cssinitial() }}:</dfn> {{ Cssxref("nowrap") }}</li> <li><dfn>Applies to:</dfn> flexboxes</li> <li><dfn>{{ Xref_cssinherited() }}:</dfn> no</li> <li><dfn>Media:</dfn> {{ Xref_cssvisual() }}</li> <li><dfn>{{ Xref_csscomputed() }}:</dfn> as specified</li> </nobr>
</ul>
<nobr> </nobr>
<h2>Syntax</h2>
<pre class="twopartsyntaxbox"><nobr>Formal grammar: &lt;flex-wrap&gt;{1} 
                where &lt;border-style&gt; is nowrap | wrap | wrap-reverse
</nobr>
</pre>
<nobr>
<pre>flex-direction: <em>nowrap | wrap | wrap-reverse</em>
</pre>
<h3>Values</h3>
<dl> <dd>The following values are accepted: <table class="standard-table"> <tbody> <tr> <td style="vertical-align:middle;"><code>nowrap</code></td> <td style="vertical-align:middle;">The flexbox items are laid out in a single line which may cause the flexbox to overflow. The "cross-start" is either equivalent to "start" or "before" depending <code>flex-direction</code> value</td> </tr> <tr> <td style="vertical-align:middle;"><code>wrap</code></td> <td style="vertical-align:middle;">The flexbox items break into multiple lines. The "cross-start" is either equivalent to "start" or "before" depending <code>flex-direction</code> value and the "cross-end" is the opposite of the specified "cross-start".</td> </tr> <tr> <td style="vertical-align:middle;"><code>wrap-reverse</code></td> <td style="vertical-align:middle;">Behaves the same as <code>wrap</code> but "cross-start" and "cross-end" are permuted.</td> </tr> </tbody> </table> </dd>
</dl>
<h2>Examples</h2>
<pre>element { 
  flex-wrap: nowrap;
}
</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-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>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>
</nobr>
<p><nobr></nobr></p>
Revert to this revision