mozilla

Revision 7464 of flex-direction

  • Revision slug: CSS/flex-direction
  • Revision title: flex-direction
  • Revision id: 7464
  • Created:
  • Creator: FredB
  • Is current revision? No
  • Comment Improving the value list; one or more formatting changes

Revision Content

{{ CSSRef() }}

Summary

The flex-direction CSS property specifies how flexbox items are placed in the flexbox container defining the main-axis and the direction (normal or reversed).

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

Syntax

Formal grammar: <flex-direction>{1} 
                where <flex-direction> is row | row-reverse | column | column-reverse

flex-direction: row | row-reverse | column | column-reverse

Values

The following values are accepted:

row
The flexbox's main-axis is defined to be the same as the text direction. The "main-start" and "main-end" points are the same as the content direction.
row-reverse
Behaves the same as row but the "main-start" and "main-end" points are permuted.
column
The flexbox's main-axis is the same as he block-axis. The "main-start" and "main-end" points are the same as the "before" and "after" points of the writing-mode.
column-reverse
Behaves the same as column but the "main-start" and "main-end" are permuted.

Examples

element { 
  flex-direction: row-reverse;
}

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-direction</code> <a href="/en/CSS" title="CSS">CSS</a> property specifies how flexbox items are placed in the flexbox container defining the main-axis and the direction (normal or reversed).<nobr> </nobr></p>
<ul class="cssprop"><nobr> <li><dfn>{{ Xref_cssinitial() }}:</dfn> {{ Cssxref("row") }}</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-direction&gt;{1} 
                where &lt;flex-direction&gt; is row | row-reverse | column | column-reverse
</nobr>
</pre>
<nobr> </nobr>
<pre><nobr>flex-direction: <em>row | row-reverse | column | column-reverse</em>
</nobr>
</pre>
<h3>Values</h3>
<p>The following values are accepted:</p>
<dl> <dt><code>row</code></dt> <dd>The flexbox's main-axis is defined to be the same as the text direction. The "main-start" and "main-end" points are the same as the content direction.</dd> <dt><code>row-reverse</code></dt> <dd>Behaves the same as <code>row</code> but the "main-start" and "main-end" points are permuted.</dd> <dt><code>column</code></dt> <dd>The flexbox's main-axis is the same as he block-axis. The "main-start" and "main-end" points are the same as the "before" and "after" points of the writing-mode.</dd> <dt><code>column-reverse</code></dt> <dd>Behaves the same as <code>column</code> but the "main-start" and "main-end" are permuted.</dd>
</dl>
<h2>Examples</h2>
<pre>element { 
  flex-direction: row-reverse;
}
</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-direction" title="http://dev.w3.org/csswg/css3-flexbox/#flex-direction">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