/*Custom Carousel Styling for Mobile Devices*/
@media (max-width: 425px){
#banner-one img{
background-image: url("/images/mobile_banner1.jpg") !important;
}
#banner-two img{
background-image: url("/images/mobile_banner2.jpg") !important;
}
#banner-three img{
background-image: url("/images/mobile_banner3.jpg") !important;
}
#banner-four img{
background-image: url("/images/mobile_banner4.jpg") !important;
}
}
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div id="banner-one" class="carousel-item active">
<img class="d-block w-100" src="/images/banner-one.jpg" alt="First slide">
</div>
<div id="banner-two" class="carousel-item">
<img class="d-block w-100" src="/images/banner-two.jpg" alt="Second slide">
</div>
<div id="banner-three" class="carousel-item">
<img class="d-block w-100" src="/images/banner-three.jpg" alt="Third slide">
</div>
<div id="banner-four" class="carousel-item">
<img class="d-block w-100" src="/images/banner-four.jpg" alt="Fourth slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
I encountered a challenge with my Bootstrap Carousel in my project, as it functions flawlessly across all views except on mobile devices. I attempted several solutions to modify the carousel images for each slide specifically in the Mobile View, but unfortunately, nothing seemed to work as intended.