mozilla

Revision 4496 of align-items

  • Revision slug: CSS/align-items
  • Revision title: align-items
  • Revision id: 4496
  • Created:
  • Creator: FredB
  • Is current revision? No
  • Comment Creation of the flex-align property page; page created, 250 words added

Revision Content

{{ CSSRef() }}

Summary

The flex-align CSS property aligns flexbox items of the current flexbox line the same way as flex-pack but in the perpendicular direction.

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

Syntax

Formal grammar: <flex-align> 
                where <flex-align> is start | end | center | baseline | stretch

flex-align: start | end | center | baseline | stretch

Values

start
The cross-start margin edge of the flexbox item is flushed with the cross-start edge of the line.
end
The cross-end margin edge of the flexbox item is flushed with the cross-end edge of the line.
center
The flexbox item's margin box is centered within the line on the cross-axis. If the cross-size of the item is larger than the flexbox, it will overflow equally in both directions.
baseline
All flexbox items are aligned such that their baselines align. The item with the largest distance between its cross-start margin edge and its baseline is flushed with the cross-start edge of the line.
stretch
Flexbox items are stretched such as the cross-size of the item's margin box is the same as the line while respecting width and height constraints.

Examples

 

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-align</code> <a href="/en/CSS" title="CSS">CSS</a> property aligns flexbox items of the current flexbox line the same way as <a href="/en/CSS/flex-pack" title="flex-pack"><code>flex-pack</code></a> but in the perpendicular direction.<nobr> </nobr></p>
<ul class="cssprop"><nobr> <li><dfn>{{ Xref_cssinitial() }}:</dfn> stretch</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-align&gt; 
                where &lt;flex-align&gt; is start | end | center | baseline | stretch
</nobr>
</pre>
<nobr> </nobr>
<pre><nobr>flex-align: <em>start | end | center | baseline | stretch</em>
</nobr>
</pre>
<h3>Values</h3>
<dl> <dt><code>start</code></dt> <dd>The cross-start margin edge of the flexbox item is flushed with the cross-start edge of the line.</dd> <dt><code>end</code></dt> <dd>The cross-end margin edge of the flexbox item is flushed with the cross-end edge of the line.</dd> <dt><code>center</code></dt> <dd>The flexbox item's margin box is centered within the line on the cross-axis. If the cross-size of the item is larger than the flexbox, it will overflow equally in both directions.</dd> <dt><code>baseline</code></dt> <dd>All flexbox items are aligned such that their baselines align. The item with the largest distance between its cross-start margin edge and its baseline is flushed with the cross-start edge of the line.</dd> <dt><code>stretch</code></dt> <dd>Flexbox items are stretched such as the cross-size of the item's margin box is the same as the line while respecting width and height constraints.</dd>
</dl>
<h2>Examples</h2>
<pre> </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-align" title="http://dev.w3.org/csswg/css3-flexbox/#flex-align">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