Is there a way for an image to automatically adjust its size based on the height of the container? I have specified a height, but my nested img tag refuses to scale down and keeps overflowing my .modal-wrapper .modal
div. To prevent this, I currently have overflow:hidden
set, which hides the image. However, I need the image to resize proportionally and stay within the div.
I have experimented with the following CSS properties:
height: auto;
max-width: 100%;
Link to code example: https://jsfiddle.net/0rq9newh/