I'm dealing with an image that has a very high resolution. I've managed to set the width to 100% without any issues, but I'm struggling to find a way to set the height without stretching the image.
Here's my HTML:
<div class="container">
<div class="image">
<img src="Post1.jpg" alt="">
</div>
</div>
CSS:
.div{
max-height:500px
}
img{
width:100%;
height:auto;
max-height:100%;
}
Does anyone know how I can set a proper height for the image without stretching it?