I am looking to implement a sticky footer within an absolutely positioned div element.
My initial approach was to position the footer div absolutely as well - within an additional relatively positioned "page" div (which would contain the main content of the page):
<div class="content">
<div class="page">
...Some Lorem ipsum content...
<div class="footer">Some footer</div>
</div>
</div>
with the specific styles outlined below:
.content {
position: absolute;
top: 60px;
right: 0;
bottom: 0;
left: 0;
}
.page {
position: relative;
min-height: 100%;
}
.footer {
height: 30px;
position: absolute;
right: 0;
bottom: 0;
left: 0;
}
Despite my efforts, this method does not function properly as the footer ends up overlapping the text when the page is resized. How can I fix this issue and prevent the overlap?
To see a more elaborate and functional example with the complete layout structure, check out this link: https://jsfiddle.net/8nrukse9/2/