Looking to achieve a layout where, on desktop sizes, I have 5 equal-width columns spaced evenly. When viewed on mobile, it should break down to 1 column. And on medium sizes, I want it to break down into two rows with the bottom row evenly spaced and centered below the top row, like this:
https://i.sstatic.net/8EVAA.jpg
Is there a way to achieve this using Bootstrap 5 built-in classes, or would I need to add custom CSS for this setup? Here's what I have tried so far:
img {
max-width:100%;
}
.row .col-6 {
margin-top:30px;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="82e0ededf6f1f6f0e3f2c2b7acb2acb0">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="container">
<div class="row text-center justify-content-between">
<div class="col-6 col-md-auto">
<img src="https://via.placeholder.com/200x100" />
</div>
<div class="col-6 col-md-auto">
<img src="https://via.placeholder.com/200x100" />
</div>
<div class="col-6 col-md-auto">
<img src="https://via.placeholder.com/200x100" />
</div>
<div class="col-6 col-md-auto">
<img src="https://via.placeholder.com/200x100" />
</div>
<div class="col-6 col-md-auto">
<img src="https://via.placeholder.com/200x100" />
</div>
</div>
</div>
Current issue: The 4th column is aligning directly below the 1st column, and the 5th column is aligning below the 3rd column.