Although the majority of pages on my site have sufficient content to naturally push the footer to the bottom of the page for most users. I want to ensure that it remains fixed at the bottom regardless of screen size going forward.
I've experimented with various methods like using bottom: 0x;
, position:absolute;
, among others, but none seem to work consistently. Sometimes the footer gets pushed out of its container when trying to fix it at the bottom using these approaches.
Below is the HTML and CSS code for the two components of the footer (footer & copyright bar), both contained within a <section id="footer">
div
.
I have removed my previous attempts at fixing it in place so that others can assess the current code and suggest modifications. Please take a look at the website URL provided to see the issue firsthand:
Live URL -
(This is a restaurant website. The term 'naked' is part of the website name).
HTML Code:
<section id="footer">
<div class="container">
<div class="row">
<div class="span1">
<div id="small-logo">
<img src="img/small-logo.png" />
</div>
</div>
<div class="span2">
<div class="footer-list">
<h6>OUR BOXES</h6>
<ul>
<a href="#">
<li>Classic Box</li>
</a>
<a href="#">
<li>Vegetarian Box</li>
</a>
<a href="#">
<li>Family Box</li>
</a>
<a href="#">
<li>Dinner Party Box</li>
</a>
<a href="#">
<li>Gift Box</li>
</a>
</ul>
</div>
</div>
<div class="span2">
<div class="footer-list">
<h6>OUR RECIPES</h6>
<ul>
<a href="#">
<li>Last Weeks Feature</li>
</a>
<a href="#">
<li>Next Weeks Feature</li>
</a>
</ul>
</div>
</div>
<div class="span2">
<div class="footer-list">
<h6>ABOUT US</h6>
<ul>
<a href="#">
<li>The Food</li>
</a>
<a href="#">
<li>How We Source</li>
</a>
<a href="#">
<li>Sustainability</li>
</a>
<li><a href="about.html">About Us</a></li>
<a href="#">
<li>Contact Us</li>
</a>
</ul>
</div>
</div>
<div class="span5">
<div id="twitter">
<img src="img/twitter-logo.png" alt="" title="" height="50" width="50" class="twitter-logo" />
<div class="tweet-bg">
<div class="tweets">
<p>@chefallanp that's just not on really</p>
</div>
<div id="follow-btn">
<img src="img/follow-us.jpg" />
</div>
</div>
</div>
<div class="checkout-options">
<h6>SECURE CHECKOUT</h6>
<ul>
<li><img src="img/solo-logo.png" /></li>
<li><img src="img/switch-logo.png" /></li>
<li><img src="img/maestro-logo.png" /></li>
<li><img src="img/visa-logo.png" /></li>
<a href="#">
<li><img src="img/facebook-logo.png" /></li>
</a>
<a href="#">
<li><img src="img/twitter-logo-flat.png" /></li>
</a>
</ul>
</div>
</div>
</div>
</div>
<div id="copyright-bar">
<div class="container">
<div class="row">
<div class="copyright-content">
<div class="span4">
<p>The Naked Radish Limited. 2013 All rights reserved.</p>
</div>
<div class="span4 offset4">
<div class="copyright-list">
<ul>
<a href="terms.html">
<li>Terms & Conditions</li>
</a>
<a href="privacy.html">
<li> - Privacy Policy</li>
</a>
<a href="#">
<li> - Cookie Policy</li>
</a>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
CSS Style:
#footer {
background-color: #F3F3F3;
padding-top: 10px;
padding-bottom: 0px;
}