I have a basic flexbox container with 2 items..
html, body {
margin:0;
}
.container {
display: flex;
flex-direction:row;
}
.item div {
width: 100%;
padding-bottom: 56.25%;
background: gold;
}
img {
max-width:100%;
object-fit:cover;
}
<div class="container">
<div class="item">
<div>
<img src="https://placeimg.com/1000/1000/any/grayscale">
</div>
</div>
<div class="item">
<div>
<img src="https://placeimg.com/1000/1000/any/grayscale">
</div>
</div>
</div>
Following the code at Maintain the aspect ratio of a div with CSS - I am trying to make the 2 items 16:9. But it is not working as expected.
Where am I going wrong?