CSS3 Flexbox: Justify-Content: Space-Around

The following example shows the result of using the space-around value:

HTML file: Displayed by browser:
<style>
.flex-container {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-around;
    justify-content: space-around;
    width: 400px;
    height: 250px;
    background-color: lightgrey;
}
.flex-item {
    background-color: cornflowerblue;
    width: 100px;
    height: 100px;
    margin: 10px;
}
</style>
<body>
<div class="flex-container">
    <div class="flex-item">flex item 1</div>
    <div class="flex-item">flex item 2</div>
    <div class="flex-item">flex item 3</div>
</div>
<p>Spaces are placed before, between and after each flex-item.</p>
</body>
flex item 1
flex item 2
flex item 3

Spaces are placed before, between and after each flex-item.


Back button Table of Contents Next button