align-content

  • Revision slug: CSS/align-content
  • Revision title: align-content
  • Revision id: 4495
  • Created:
  • Creator: FredB
  • Is current revision? No
  • Comment 11 words added

Revision Content

{{ CSSRef() }}

{{ SeeCompatTable() }}

Summary

The align-content CSS property aligns a flex container's lines within the flex container when there is extra space on the cross-axis.

  • {{ Xref_cssinitial() }}: stretch
  • Applies to: multi-line flex containers
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified

See Using CSS flexible boxes for more properties and information.

Syntax

Formal grammar: <align-content> 
               where <align-content> is flex-start | flex-end | center | justify | distribute | stretch
align-content: flex-start | flex-end | center | justify | distribute | stretch

Values

flex-start
Lines are packed starting from the cross-start. Cross-start edge of the first line and cross-start edge of the flex container are flushed together. Each following line is flush with the preceding.
flex-end
Lines are packed starting from the cross-end. Cross-end of the last line and cross-end of the flex container are flushed together. Each preceding line is flushed with the following line.
center
Lines are packed toward the center of the flex container. The lines are flushed with each other and aligned in the center of the flex container. Space between the cross-start edge of the flex container and first line and between cross-end of the flex container and the last line is the same.
space-between
Lines are evenly distributed in the flex container. The spacing is done such as the space between two adjacent items is the same. Cross-start edge and cross-end edge of the flex container are flushed with respectively first and last line edges.
space-around
Lines are evenly distributed so that the space between two adjacent lines is the same. The empty space before the first and after the last lines equals half of the space between two adjacent lines.
stretch
Lines stretch to use the remaining space. The free-space is split equally between all the lines.

Examples

 

Specifications

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

Browser compatibility

{{ page{path: "/en/CSS/Using_CSS_flexible_boxes", section: "Browser compatibility"} }}

See also

Revision Source

<p>{{ CSSRef() }}</p>
<p>{{ SeeCompatTable() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>align-content</code> <a href="/en/CSS" title="CSS">CSS</a> property aligns a flex container's lines within the flex container when there is extra space on the cross-axis.</p>
<nobr>
<ul class="cssprop"> <li><dfn>{{ Xref_cssinitial() }}:</dfn> <code>stretch</code></li> <li><dfn>Applies to:</dfn> multi-line flex containers</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>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.</nobr></p><h2 id="Syntax"><nobr>Syntax</nobr></h2><nobr>
<pre class="twopartsyntaxbox">Formal grammar: &lt;align-content&gt; 
               where &lt;align-content&gt; is flex-start | flex-end | center | justify | distribute | stretch
</pre>
<pre>align-content: <em>flex-start | flex-end | center | justify | distribute | stretch</em>
</pre>
<h3 id="Values">Values</h3>
<dl> <dt><code>flex-start</code></dt> <dd>Lines are packed starting from the cross-start. Cross-start edge of the first line and cross-start edge of the flex container are flushed together. Each following line is flush with the preceding.</dd> <dt><code>flex-end</code></dt> <dd>Lines are packed starting from the cross-end. Cross-end of the last line and cross-end of the flex container are flushed together. Each preceding line is flushed with the following line.</dd> <dt><code>center</code></dt> <dd>Lines are packed toward the center of the flex container. The lines are flushed with each other and aligned in the center of the flex container. Space between the cross-start edge of the flex container and first line and between cross-end of the flex container and the last line is the same.</dd> <dt><code>space-between</code></dt> <dd>Lines are evenly distributed in the flex container. The spacing is done such as the space between two adjacent items is the same. Cross-start edge and cross-end edge of the flex container are flushed with respectively first and last line edges.</dd> <dt><code>space-around</code></dt> <dd>Lines are evenly distributed so that the space between two adjacent lines is the same. The empty space before the first and after the last lines equals half of the space between two adjacent lines.</dd> <dt><code>stretch</code></dt> <dd>Lines stretch to use the remaining space. The free-space is split equally between all the lines.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre> </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/#align-content" title="http://dev.w3.org/csswg/css3-flexbox/#align-content">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{path: "/en/CSS/Using_CSS_flexible_boxes", section: "Browser compatibility"} }}</p>
<h2 id="See_also">See also</h2>
</nobr><p><nobr></nobr><nobr></nobr></p>
Revert to this revision