CSS - align-content
align-content
align-content
aligns the content of the box. you also have to have the flex attribute set to true for this to work.
align-content available values
align-content: stretch|center|flex-start|flex-end|space-between|space-around|initial|inherit;
Example using align-content: center;
Property Variable Name
align-content
Available Values for align-content
stretch|center|flex-start|flex-end|space-between|space-around|initial|inherit
Examples Using align-content values
Example using align-content stretch
Demo using align-content stretch
Here is an example using align-content:stretch;
Code
<style>
.demo-box-1 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
align-content:stretch;
}
</style>
<h2>Demo using align-content stretch</h2>
<p>Here is an example using <code>align-content:stretch;</code></p>
<div class='demo-box-1'>Demo Box 1 Content</div>
Example using align-content center
Demo using align-content center
Here is an example using align-content:center;
Code
<style>
.demo-box-2 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
align-content:center;
}
</style>
<h2>Demo using align-content center</h2>
<p>Here is an example using <code>align-content:center;</code></p>
<div class='demo-box-2'>Demo Box 2 Content</div>
Example using align-content flex-start
Demo using align-content flex-start
Here is an example using align-content:flex-start;
Code
<style>
.demo-box-3 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
align-content:flex-start;
}
</style>
<h2>Demo using align-content flex-start</h2>
<p>Here is an example using <code>align-content:flex-start;</code></p>
<div class='demo-box-3'>Demo Box 3 Content</div>
Example using align-content flex-end
Demo using align-content flex-end
Here is an example using align-content:flex-end;
Code
<style>
.demo-box-4 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
align-content:flex-end;
}
</style>
<h2>Demo using align-content flex-end</h2>
<p>Here is an example using <code>align-content:flex-end;</code></p>
<div class='demo-box-4'>Demo Box 4 Content</div>
Example using align-content space-between
Demo using align-content space-between
Here is an example using align-content:space-between;
Code
<style>
.demo-box-5 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
align-content:space-between;
}
</style>
<h2>Demo using align-content space-between</h2>
<p>Here is an example using <code>align-content:space-between;</code></p>
<div class='demo-box-5'>Demo Box 5 Content</div>
Example using align-content space-around
Demo using align-content space-around
Here is an example using align-content:space-around;
Code
<style>
.demo-box-6 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
align-content:space-around;
}
</style>
<h2>Demo using align-content space-around</h2>
<p>Here is an example using <code>align-content:space-around;</code></p>
<div class='demo-box-6'>Demo Box 6 Content</div>
Example using align-content initial
Demo using align-content initial
Here is an example using align-content:initial;
Code
<style>
.demo-box-7 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
align-content:initial;
}
</style>
<h2>Demo using align-content initial</h2>
<p>Here is an example using <code>align-content:initial;</code></p>
<div class='demo-box-7'>Demo Box 7 Content</div>
Example using align-content inherit
Demo using align-content inherit
Here is an example using align-content:inherit;
Code
<style>
.demo-box-8 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
align-content:inherit;
}
</style>
<h2>Demo using align-content inherit</h2>
<p>Here is an example using <code>align-content:inherit;</code></p>
<div class='demo-box-8'>Demo Box 8 Content</div>