I'm currently working on the "Top Categories" section of my website and I'm facing issues with making the image cards responsive. Despite using flexbox classes from Bootstrap 4, I am unable to achieve the desired responsiveness. Can anyone help me figure out what I may be missing?
Here is the CODEPEN
Below is the code:
index.html
.Top-Categories {
width: 267px;
height: 29px;
padding-bottom: 24px;
font-family: arial;
font-size: 24px;
font-weight: bold;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: normal;
text-align: left;
color: #4a4a4a;
}
.Top-Categories-Img-Card {
width: 1104px;
margin-left: 205px;
margin-right: 205px;
}
.Top-Categories-Img {
width: 159px;
height: 238px;
}
.Top-Categories-Label {
width: 93px;
height: 15px;
padding-left: 0px;
font-family: arial;
font-size: 12px;
font-weight: bold;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: normal;
text-align: left;
color: #4a4a4a;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<section class="Top-Categories-Img-Card">
<h3 class="Top-Categories">Top Categories</h3>
<div class="row">
<div class="col-sm-12 col-md-2">
<div class="">
<img class="card-img-top Top-Categories-Img" src="https://www.dropbox.com/s/9h4jk5s6ca0suqu/pic2.jpg?raw=1" alt="Card image">
<div class="card-body">
<a href="#" class="Top-Categories-Label">Fun & Recreation</a>
</div>
</div>
</div>
<div class="col-sm-12 col-md-2">
<div class="">
<img class="card-img-top Top-Categories-Img" src="https://www.dropbox.com/s/9h4jk5s6ca0suqu/pic2.jpg?raw=1" alt="Card image">
<div class="card-body">
<a href="#" class="Top-Categories-Label">Education & Skill Development</a>
</div>
</div>
</div>
<div class="col-sm-12 col-md-2">
<div class="">
<img class="card-img-top Top-Categories-Img" src="https://www.dropbox.com/s/9h4jk5s6ca0suqu/pic2.jpg?raw=1" alt="Card image">
<div class="card-body">
<a href="#" class="Top-Categories-Label">Informative & Motivational</a>
</div>
</div>
</div>
<div class="col-sm-12 col-md-2">
<div class="">
<img class="card-img-top Top-Categories-Img" src="https://www.dropbox.com/s/9h4jk5s6ca0suqu/pic2.jpg?raw=1" alt="Card image">
<div class="card-body">
<a href="#" class="Top-Categories-Label">Health & Fitness</a>
</div>
</div>
</div>
<div class="col-sm-12 col-md-2">
<div class="">
<img class="card-img-top Top-Categories-Img" src="https://www.dropbox.com/s/9h4jk5s6ca0suqu/pic2.jpg?raw=1" alt="Card image">
<div class="card-body">
<a href="#" class="Top-Categories-Label">Kids & Teens</a>
</div>
</div>
</div>
<div class="col-sm-12 col-md-2">
<div class="">
<img class="card-img-top Top-Categories-Img" src="https://www.dropbox.com/s/9h4jk5s6ca0suqu/pic2.jpg?raw=1" alt="Card image">
<div class="card-body">
<a href="#" class="Top-Categories-Label">Home Maintenance</a>
</div>
</div>
</div>
</div>
</section>