I have two side by side flex elements with fixed width, one with text and one with an image. How can I force the size of the image in the right container to dynamically match the height of the text in the left container, while preserving the aspect ratio and avoiding cropping?
.flexbox {
border: 1px solid;
width: 400px;
margin: 10px;
display: flex;
}
.left {
width: 60%;
}
.right {
width: 40%;
display: flex;
justify-content: flex-end;
}
<div class="flexbox">
<div class="left">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
</div>
<div class="right">
<img src="https://via.placeholder.com/100x200" class="placeholder" />
</div>
</div>