I am currently working on a site that shows some info in boxes. My goal right now is to have 2 div boxes fit on each line. I made it so that more than one div can be on the same line with the code below, but I realized that if I had more than 2 they would all still stack on the same line.
I am not totally sure how I would limit my divs to 2 per line. Some help would be greatly appreciated!
.flex-container {
display: flex;
}
.flex-child {
flex: 1;
/*border: 2px solid yellow;*/
display: flex;
justify-content: center;
margin: 5px;
margin-top: 20px;
padding: 100px;
background: #7d7d7d;
border-radius: 30px;
margin-left: 10px;
margin-right: 10px;
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
font-size: 50px;
color: white;
}
.flex-child:first-child {
display: flex;
justify-content: center;
margin: 5px;
margin-top: 20px;
padding: 100px;
background: #7d7d7d;
border-radius: 30px;
margin-right: 10px;
margin-left: 10px;
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
font-size: 50px;
color: white;
}
<div class="flex-container">
<div class="flex-child"></div>
<div class="flex-child"></div>
<div class="flex-child"></div>
<div class="flex-child"></div>
</div>