-2

So im trying to make the footer stick to the bottom of the page like this http://cleanstickyfooter.herokuapp.com/

(zooming out and the footer still stays at the bottom)

How can i achieve this?

this is a test i made, please help me understand what i need to do because the footer is not staying at the bottom. http://trulyamped.com/responr/Responr.html

TeoAlmonte
  • 107
  • 1
  • 7

2 Answers2

0

This is easily achieved using fixed positioning:

.body .mainfooter {
    height: auto;
    margin-top: 0;
    margin-bottom: 0;
    position: fixed;
    bottom: 0;
}
blend
  • 640
  • 4
  • 6
  • Remember that fixed footers and headers are a real mess when they're viewed on mobile devices, behaving differently and quite badly. My opinion is that you should avoid them at all if you can. – Alan Piralla Jun 10 '13 at 13:28
  • we can also use media query to switch fixed positions to relative positions for mobile devices. – hmhcreative Jun 10 '13 at 14:37
0
    <div id='footer'>...</div> // if we say that this is the footer div 

    <style type='text/css'>
    #footer{
    display:block;
    position:fixed;
    bottom:0px;
    height:70px;

    }
   </style>
Sora
  • 2,465
  • 18
  • 73
  • 146