I've used a CSS solution that has proved flexible.
You need choose one element to be the one that is full height. It also needs to be a parent to every content block. This can be the <body>
element or anywhere in the DOM.
Additionally, you must designate one child to grow to make up whatever space is needed to stretch to fill the screen.
.content-parent {
min-height: 100vh; /* Forces to always fill the screen vertically... */
min-height: -webkit-fill-available; /* ...except on mobile, when you want to stay within the chrome */
display: flex; /* Enable content to stretch... */
flex-direction: column; /* ...vertically */
}
.filler-child {
flex-grow: 1; /* Designates this element to stretch to fill */
}
Example HTML:
<html>
<head>...</head>
<body>
<div class="parent">
<div class="hero">...</div>
<div class="content filler-child">...</div>
<div class="footer">...</div>
</div>
</body>
</html>