Utilizing twitter-bootstrap 4.4, I am attempting to create a carousel with thumbnails. My goal is to fit the image into a fixed 4:3 ratio container for a consistent look, regardless of the image's orientation.
Is there a way to ensure that the carousel-inner
container always displays in a 4:3 ratio? You can view the complete code in this jsFiddle link
Below is a simplified version of the code:
<!--Carousel Wrapper-->
<div id="carousel-thumb" class="carousel slide carousel-fade carousel-thumbnails" data-ride="carousel" data-interval="false">
<!--Slides-->
<div class="carousel-inner" role="listbox">
<!--Image 1-->
<figure class="carousel-item active">
<picture class="d-block w-100">
<img class="w-100" style="object-fit:cover;" src="https://photos.zillowstatic.com/cc_ft_768/ISv4f3q9br50lc0000000000.webp" alt="First slide">
</picture>
<figcaption class="carousel-caption d-none d-md-block">I am an image caption</figcaption>
</figure>
<!--/.Image 1-->
</div>
<!--/.Slides-->
<!--Controls-->
<a class="carousel-control-prev" href="#carousel-thumb" 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="#carousel-thumb" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<!--/.Controls-->
<!--Thumbnails-->
<ol class="carousel-indicators">
<!--Thumbnail 1-->
<li data-target="#carousel-thumb" data-slide-to="0" class="active">
<picture>
<img class="d-block w-100" src="https://photos.zillowstatic.com/cc_ft_768/ISv4f3q9br50lc0000000000.webp" class="img-thumbnail">
</picture>
</li>
<!--/.Thumbnail 1-->
</ol>
<!--/.Thumbnails-->
</div>
<!--/.Carousel Wrapper-->