I am facing an issue with my footer. I want it to always stay at the bottom of the page, but sometimes it moves up if there is a large element above it. Can anyone suggest a solution to ensure that the footer always remains at the bottom?
Below is the CSS code I currently have:
.footer {
position:absolute;
bottom:0;
width:100%;
background-color:#151211;
line-height: 16px;
padding: 0px 0px 20px 0px;
}
.footer .nav {
float:left;
}
.footer li {
display:inline;
}
.footer li:before{
color:#262320;
content:" | ";
}
.footer li:first-child:before {
content:"";
}
.footer a:hover {
color:#ffcc66;
}
.footer .nav a.login {
background: url("../img/icon-lock.png") no-repeat 11px 5px #5c5a58;
background-color: rgba(255,255,255,0.25);
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
color: #262320;
font-size: 10px;
font-weight: bold;
padding: 7px 9px 8px 32px;
text-transform: uppercase;
}
.footer .nav a.login:hover {
background-color: #939190;
background-color: rgba(255,255,255,0.5);
}
.copyright {
color:#fff;
font-size:16px;
padding-top: 2px;
text-align:right;
}
.copyright span {
color:#262320;
}
If necessary, below is the HTML code I am using:
<div class="footer">
<div class="liner">
<div class="nav">
<ul>
<li><a href="http://removed/ui/faces/login.xhtml" class="login">Client Login</a></li>
<li><a href="contactus.php" class="">Contact</a></li>
<li><a href="termsofuse.php" class="">Terms of Service</a></li>
<li><a href="privacy.php" class="">Privacy Policy</a></li>
<li><div class="fb-like" data-href="https://www.facebook.com/pages/removed/412357755542469" data-width="50" data-height="50" data-colorscheme="light" data-layout="standard" data-action="like" data-show-faces="false" data-send="true" style="top: 10px;"></div></li>
<li><a href="https://twitter.com/removed" class="twitter-follow-button" data-show-count="false">Follow @removed</a>
<script>!function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = p + '://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js, fjs);
}
}(document, 'script', 'twitter-wjs');</script></li>
</ul>
</div> <!-- .nav -->
<p class="copyright">© Copyright 2013 <span>|</span>removed</p>
</div> <!-- .liner -->
</div> <!-- .footer -->