I'd like to have a div maintain it's aspect ratio while also having a max height. I have been able to maintain the aspect ratio in most cases, except when I hit my media query:
@media only screen and (min-width: 59.063em) {
#wrapper {
max-width: 59.063em;
}
}
When I hit the max-width and make the size of my screen smaller (I noticed this when I was in Developer Tools), the height continues to grow and overflows the parent. For example: https://i.stack.imgur.com/rtJLc.png
It can be found here: http://codepen.io/TrevorRice/pen/jEooQG
I tried using
#wrapper {
...
max-height: 90%;
...
}
but this also breaks the aspect ratio.
Any ideas?