No matter how much I've tried, I can't seem to find a solution on how to make my image responsive along with the caption. Below is my HTML code:
<section id="banner">
<div class="banner-bg">
<div class="banner-bg-item"><div class="textoverlay"><h3 id="caption1">Suburban Mumbai’s Best Serviced Apartment</h3><h3 id="caption2">The Perfect Home Away From Home</h3>
</div>
<img class='img-responsive' src="<?php echo base_url('assets/img/slider-1.jpg'); ?>" alt="">
</div>
<div class="banner-bg-item"><div class="textoverlay"><h3 id="caption1">Suburban Mumbai’s Best Serviced Apartment</h3><h3 id="caption2">The Perfect Home Away From Home</h3>
</div>
<img class='img-responsive' src="<?php echo base_url('assets/img/slider-2.jpg'); ?>" alt="">
</div>
<div class="banner-bg-item"><div class="textoverlay"><h3 id="caption1">Suburban Mumbai’s Best Serviced Apartment</h3><h3 id="caption2">The Perfect Home Away From Home</h3>
</div>
<img class='img-responsive' src="<?php echo base_url('assets/img/slider-3.jpg'); ?>" alt="">
</div>
<div class="banner-bg-item"><div class="textoverlay"><h3 id="caption1">Suburban Mumbai’s Best Serviced Apartment</h3><h3 id="caption2">The Perfect Home Away From Home</h3>
</div>
<img class='img-responsive' src="<?php echo base_url('assets/img/slider-4.jpg'); ?>" alt="">
</div>
<div class="banner-bg-item"><div class="textoverlay"><h3 id="caption1">Suburban Mumbai’s Best Serviced Apartment</h3><h3 id="caption2">The Perfect Home Away From Home</h3>
</div>
<img class='img-responsive' src="<?php echo base_url('assets/img/slider-5.jpg'); ?>" alt="">
</div>
</div>
</div>
Also, here is my CSS code:
#banner .banner-bg .banner-bg-item {
height: 100vh;
min-height: 650px;
background-size: cover;
background-position: center;
}
#banner .banner-bg .banner-bg-item .img-responsive{
max-width: 100%;
height: auto !important;
display:block;
}
@media (max-width: 768px) {
#banner .banner-bg .banner-bg-item {
min-height: 920px;
}
.banner-bg .banner-bg-item .textoverlay{
padding-top: 30%;
padding-left: 12%;
color: white;
}
.banner-bg .banner-bg-item .textoverlay #caption1{
background-color: rgba(0, 26, 9, 0.3);
width: 640px;
}
.banner-bg .banner-bg-item .textoverlay #caption2{
background-color: rgba(0, 26, 9, 0.3);
width: 500px;
}
I have provided both the HTML and CSS codes for my website, but unfortunately, I have not been able to make my images responsive despite using Owl Carousel for the slider. Any help or guidance in solving this issue would be greatly appreciated as my efforts to find a solution online have been unsuccessful so far.