Hey, I am currently working on implementing a Bootstrap carousel on my webpage. However, I am encountering an issue with the display of images uploaded by users. When a user uploads a large image, it ends up overflowing on my webpage. How can I ensure that the size of the uploaded image follows the dimensions of the carousel, which spans 100% of the view screen? Even if the uploaded image is square, I want it to expand to fit within the carousel.
Below is the layout of my webpage:
Webpage Screenshot
After trying one solution provided to add CSS:
img.d-block{
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
This resulted in the following changes:
Here is a snippet from my bootstrap5.css file:
.carousel {
// CSS properties for carousel styling
}
Additionally, here is how my index.blade.php file looks like:
<div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel">
<!-- Carousel HTML content here -->
</div>