<div class="caption">justify-content: space-between; (default)</div>
<div class="flex-container-space-between">
<div>
<p>1</p>
</div>
<div>
<p>2</p>
</div>
<div>
<p>3</p>
</div>
<div>
<p>4</p>
</div>
<div>
<p>5</p>
</div>
<div>
<p>6</p>
</div>
</div>
<div class="caption">justify-content: space-around;</div>
<div class="flex-container-space-around">
<div>
<p>1</p>
</div>
<div>
<p>2</p>
</div>
<div>
<p>3</p>
</div>
<div>
<p>4</p>
</div>
<div>
<p>5</p>
</div>
<div>
<p>6</p>
</div>
</div>
<div class="caption">justify-content: space-evenly;</div>
<div class="flex-container-space-evenly">
<div>
<p>1</p>
</div>
<div>
<p>2</p>
</div>
<div>
<p>3</p>
</div>
<div>
<p>4</p>
</div>
<div>
<p>5</p>
</div>
<div>
<p>6</p>
</div>
</div>
.flex-container-space-between,
.flex-container-space-around,
.flex-container-space-evenly {
display: flex;
background-color: lighten(darkorange, 20%);
border: 1px solid black;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
& div {
border: 1px solid black;
width: 48px;
height: 48px;
background-color: darkorange;
}
p {
text-align: center;
}
}
.flex-container-space-between {
justify-content: space-between;
}
.flex-container-space-around {
justify-content: space-around;
}
.flex-container-space-evenly {
justify-content: space-evenly;
}
.caption {
text-align: center;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.