justify content space between with 3 columns code example
Example 1: flexbox center and space between
//You have to give an automatic margin to all the items inside the flex.
.flexbox {
display: flex;
justify-content: space-between;
}
.flex-item {
margin: auto;
}
Example 2: proper way to make flexbox spacing
.upper
{
margin:30px;
display:flex;
flex-direction:row;
width:300px;
height:80px;
border:1px red solid;
padding:5px;
}
.upper > div
{
flex:1 1 auto;
border:1px red solid;
text-align:center;
margin:5px;
}
.upper.mc
{flex-direction:column;flex-wrap:wrap;width:200px;height:200px;}
<div class="upper">
<div>aaa<br/>aaa</div>
<div>aaa</div>
<div>aaa<br/>aaa</div>
<div>aaa<br/>aaa<br/>aaa</div>
<div>aaa</div>
<div>aaa</div>
</div>
<div class="upper mc">
<div>aaa<br/>aaa</div>
<div>aaa</div>
<div>aaa<br/>aaa</div>
<div>aaa<br/>aaa<br/>aaa</div>
<div>aaa</div>
<div>aaa</div>
</div>