I am working with Flexbox and have simple layout
.container {
display:flex;
flex-direction:row;
}
.image-wrapper {
flex:1;
position: relative;
padding-bottom: 56.2%;
}
.image-wrapper img {
position: absolute;
object-fit: cover;
width: 100%;
height: 100%;
}
<div class="container">
<!-- Image start -->
<div class="image-wrapper">
<img src="https://dummyimage.com/1500x1000/000/fff" alt="" />
</div>
<div class="image-wrapper">
<img src="https://dummyimage.com/1500x1000/000/fff" alt="" />
</div>
<div class="image-wrapper">
<img src="https://dummyimage.com/1500x1000/000/fff" alt="" />
</div>
<!-- Image end -->
</div>
I am trying to ensure that the images are all 16:9 aspect ratio. This works without flexbox, but as soon as I make my divs flex then it no longer works.
What am I doing wrong?