This seems like a popular question, but even after incorporating some of the suggestion, I don't get the desired result.
I have a footer and I want it to be at the bottom of the page. Here's my HTML and CSS: (the hi' are just placeholder content)
HTML:
<body>
<ul>
<li> Hi </li>
<li> Hi </li>
<li> Hi </li>
<li> Hi </li>
<li> Hi </li>
<li> Hi </li>
<li> Hi </li>
<li> Hi </li>
<li> Hi </li>
<li> Hi </li>
</ul>
<div class="navbar navbar-default footer">
<div class="container">
<ul class="nav navbar-nav">
<li><a href="#"> Blog </a></li>
<li> <a href="#"> Terms of use </a></li>
<li><a href="#"> Contact us </a></li>
</ul>
<a href="#" class="navbar-btn btn-info btn pull-right">
<i class="fa fa-twitter" aria-hidden="true"></i> Follow us on Twitter! </a>
</div>
</div>
</body>
CSS:
.footer {
bottom:0;
position: absolute;
width:100%;
}
body {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
height:100%;
min-height: 100%;
}
Now if I have the position: absolute;
in the .footer
style, then the footer is at the bottom on page load, and stays at the same exact position when you scroll down. It also overlaps the content, as can be seen from the fiddle here
If I remove the position: absolute
property, then the footer isn't at the bottom of the page, and will go directly below the previous element. See here to understand what I mean LINK
I want it to be at the bottom of the page. If there's minimal content on the age, then it should go all the way to the bottom, and if there's a lot of content before the footer then it should not overlap them and go below all of them. A jQuery solution is fine as well.