I got a div surrounding an image (set to 100% width & height), trying to get it to fill 70% of the screen's height, but percentage values to the div's height have no effect, only exact px values.
.gallery {
display: block;
width: 100%;
height: 70%
}
.gallery img {
width: 100%;
height: 100%;
object-fit: cover;
}
<div class="gallery fade">
<img src="https://picsum.photos/100/100" alt="">
</div>
position:absolute;
makes it work, but completely messes up the rest of the site.
I can't really think of any way to keep the margin and make it take up 70% of the screen height.
Using background-image would still need absolute position plus wouldn't work with the animations I have set up.