Flexbox Boxes
body {
padding: 0;
margin: 0;
}
.card-container {
display: flex;
flex-direction: row;
justify-content: center;
flex-wrap: wrap;
margin: 10px;
}
.card {
display: flex;
flex-direction: column;
justify-content: center;
width: 350px;
height: 250px;
margin: 15px;
border-radius: 4px;
background: #3861c9;
}
@media (min-width: 768px) {
.card-container {
margin: 10px;
}
}
@media (min-width: 900px) {
.card-container {
display: flex;
flex-direction: row;
justify-content: center;
flex-wrap: wrap;
margin: 15px 0;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<div class="card-container">
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
</div>