I've been trying to limit the height of a DIV so that it is never taller than the browser window but it just isn't working. Here's a copy of the relevant HTML/CSS that you can just paste into a file to try:
.imageContainer1 {
display: block;
width: 100%;
height: 100%;
}
.imageContainer2 {
display: inline-block;
width: 100%;
height: 0;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
padding: 75% 0 0 0;
background: url("https://dancing.moe/frames/jpg/1.jpg") no-repeat;
background-size: 100% 100%;
}
<div class="imageContainer1">
<div class="imageContainer2">
</div>
</div>
The padding is to maintain an aspect ratio of 4:3. Everything's a bit out of whack since I've basically mashed together many examples.
Any ideas as to why this just won't work? Even specifying in pixels doesn't affect the child.