I am currently facing a challenge with implementing a responsive gallery slider in Bootstrap. In order to achieve responsiveness, I need to use properties like max-height.
The issue arises from the fact that the images in the gallery can vary in size and aspect ratio.
In this scenario, the .carousel div has a height of 450px. To ensure that the gallery is responsive, I want to utilize max-height while also maintaining the integrity of the image ratios within the carousel. This means that some images may exceed the boundaries of the div, or conversely, not fill the entire space. In such cases, the images should be centered both vertically and horizontally (possibly using flexbox).
Applying max-height causes the carousel to resize dynamically based on the image dimensions, resulting in a jumpy user experience. On the other hand, setting a fixed height prevents jumping but compromises on responsiveness as smaller images may not fill the entire div.