You could structure your HTML as follows:
<body>
<header class="Header"></header>
<main class="Main"></main>
<footer class="Footer"></footer>
</body>
Then, use flex box
to render the footer at the bottom of your page using the following code:
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
main {
flex: 1;
}
footer,
header {
flex: 0;
}
See a fully working demo code below and learn more about flex box here:
header::after,
main::after,
footer::after {
content: attr(class);
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
margin: 0;
}
main {
flex: 1;
}
footer,
header {
flex: 0;
}
<header class="Header"></header>
<main class="Main"></main>
<footer class="Footer"></footer>