Having trouble customizing the carousel layout for mobile devices. I'm trying to display all items of the carousel on mobile instead of just one. I've been experimenting with CSS and JS, specifically with the display
, float
, or max-width
properties, but it seems like it's not working. I'm not sure if it's even possible or if I'm looking in the wrong place.
Desired outcome: https://i.sstatic.net/kAUVY.png
Current state: https://i.sstatic.net/uDNLl.png
The HTML code provided is basic without CSS for design purposes only.
<div id="solutions-carousel" class="carousel slide d-block d-md-none">
<div class="carousel-inner">
<div class="carousel-item active">
<a href="#" class="img-link"><img src="./img.png" alt=""></a>
<a href="#">text</a>
</div>
<div class="carousel-item">
<a href="#" class="img-link"><img src="./img.png" alt=""></a>
<a href="#">text</a>
</div>
<div class="carousel-item active">
<a href="#" class="img-link"><img src="./img.png" alt=""></a>
<a href="#">text</a>
</div>
<div class="carousel-item active">
<a href="#" class="img-link"><img src="./img.png" alt=""></a>
<a href="#">text</a>
</div>
<div class="carousel-item active">
<a href="#" class="img-link"><img src="./img.png" alt=""></a>
<a href="#">text</a>
</div>
<div class="carousel-indicators">
<button type="button" data-bs-target="#solutions-carousel" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#solutions-carousel" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#solutions-carousel" data-bs-slide-to="2" aria-label="Slide 3"></button>
<button type="button" data-bs-target="#solutions-carousel" data-bs-slide-to="3" aria-label="Slide 3"></button>
<button type="button" data-bs-target="#solutions-carousel" data-bs-slide-to="4" aria-label="Slide 3"></button>
</div>
Any suggestions? Apologies for the poor English. Cheers!