Currently, I am using the latest version of the owl carousel and encountering a small issue. The problem lies in the fact that I have 3 images with varying sizes.
The main div, labeled as "mydiv," is required to have a width of 614px. However, upon closer inspection of the images, you will notice a discrepancy in height - the first image has more width, the second has more height, and the last one is slightly smaller, causing excessive space between the images and the bottom of the page.
I am seeking guidance on how to rectify this issue or fill the empty space appropriately.
$(document).ready(() => {
var owl = $('.mydiv').owlCarousel({
items: 1,
dots: true,
nav: true,
loop: false,
autoplay: false,
autoplayHoverPause: true,
mouseDrag: false,
});
})
body { background-color: green; }
.owl-prev, .owl-next {
font-size: 65px !important;
}
.owl-carousel .owl-item img {
width: 614px !important;
object-fit: cover;
}
.mydiv {
border: 2px solid red;
width: 614px !important;
}
<html>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css?">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" integrity="sha512-tS3S5qG0BlhnQROyJXvNjeEM4UpMXHrQfTGmbQ1gKmelCxlSEBUaxhRBj/EFTzpbP4RVSrpEikbmdJobCvhE3g==" crossorigin="anonymous" />
<body>
<div class="mydiv owl-carousel">
<img src="https://wallpapercave.com/wp/wp5405231.jpg" alt="cristiano post" class="newsfeed-show-img-display">
<img src="https://i.pinimg.com/originals/0b/3a/56/0b3a56ce1b5f0433f15a11115182b900.jpg" alt="cristiano post" class="newsfeed-show-img-display">
<img src="https://i.pinimg.com/170x/cd/b2/07/cdb207efa5fb886defac79b7ac646f93.jpg" alt="cristiano post" class="newsfeed-show-img-display">
</div>
<!-- JQUERY -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fd9f9292898e898f9c8dbdc9d3c8d3ce">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<!-- OWL CAROUSEL -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js" integrity="sha512-bPs7Ae6pVvhOSiIcyUClR7/q2OAsRiovw4vAkX+zJbw3ShAeeqezq50RIIcIURq7Oa20rW2n2q+fyXBNcU9lrw==" crossorigin="anonymous"></script>
</body>
</html>