https://i.sstatic.net/teeEl.gif
Just starting out with CSS, so please be patient with me. I'm working on incorporating responsive images within a card
. Initially, when there are 6 images in the same row, everything works as expected – the images span 100% of the card's width and are all vertically aligned in the middle regardless of their sizes.
However, I encounter issues when adjusting the screen size. Instead of maintaining 100% width (of the card) and vertically aligning all the images in the middle, what currently happens is that the images float to the top of the card and lose the 100% width.
This issue pertains to Bootstrap. Here is how my image class is defined:
.card-img-top {
height: 10vw;
object-fit: contain;
}
Thank you in advance for any help.
EDIT: The code
<div class="row">
<div-class="col-lg-2 col-md-4 col-6 mt-4">
<div class="card>
<img width="100%" src="https://i.ebayimg.com/images/g/mpsAAOSw9T9c~j93/s-l225.webp" class="card-img-top">
<div class="card-body" style="text-align: center";>
<div class="car-body-wrapper cards-body">
<h6 class="card-subtitle">
<a href="#foo" style="color: rgb(0, 172, 230);">BMW X3</a>
</h6><p class="card-text"> </p></div>
</div>
</div>
</div>
... //same for other 5 images