Can anyone provide assistance? I am attempting to set a maximum height for an image while keeping its width automatic. The issue is that these rules are not being applied because the parent element has a fixed position.
View the DEMO here
#myDiv {
position: fixed;
top: 100px;
left: 50%;
width: auto;
height: auto;
max-height: 100%;
background: red;
display: inline-block;
padding: 10px;
max-height: 30%;
}
#myDiv img {
width: auto;
height: 100%; // currently not working
}
Is there a CSS, JS, or jQuery solution to achieve this?