https://jsfiddle.net/nr7b2qtk/1/
HTML:
<div class="flex">
<div class="image">
<img src="https://via.placeholder.com/150">
</div>
<div class="text">
something
</div>
</div>
CSS:
.flex{
display:flex;
align-items:center
}
.text{
font-size:40px;
line-height:1.5
margin-left:auto;
background:red;color:white
}
In the above code, I want the image size to scale down to match the height of the text element (which in this case is 45px), besides manually setting the image's width/height, is there any other way to do this in pure CSS?