JSFiddle - React, Tailwind, and code Playground
HTML
<div class="pagewrap">
<p>Scroll down</p>
</div>
<footer>
<p>Fixed position, behind the .pagewrap element</p>
</footer>
CSS
body {
margin: 0;
}
.pagewrap {
background: #FFF;
width: 100%;
min-height: 100vh;
position: relative;
margin-bottom: 64px; /* should be set to = dynamic height of footer*/
z-index: 1;
}
footer {
background: #000;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
height: auto;
z-index: 0;
}
footer p {
color: #FFF;
}