0

I'm having trouble with a footer I can't make stick to the bottom of the page. It's probably just a line I forgot, I've done this multiple times in the past, so I'm sure it's just a silly mistake. I've cleaned up the page so it's easier for you to tell me what I'm forgetting. It works fine when content doesn't pass it, remove some <br />s in the content code and you'll see it does the job of staying at the bottom.

http://jsfiddle.net/MS4KJ/

#footer{
    position:absolute; 
    bottom:0px;
    width:100%;
    background-color:#aaa;
    color:#fff;
    text-align:center;
    height: 100px;
    left:0px;
}

Thanks!

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
Henrique P.
  • 131
  • 7

2 Answers2

0

Change it to:

#footer{
    position: relative; 
    bottom:0px;
    width:100%;
    background-color:#aaa;
    color:#fff;
    text-align:center;
    height: 100px;
    left:0px;
}

Else, select the maximum height and give a min-height for the #content.

#content {min-height: 350px;}
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
0

You should use:

position: relative;

or if you want sticky footer look at this tread: Making a CSS footer either sit at the bottom of the browser window or bottom of content

and this site: http://ryanfait.com/sticky-footer/

Edit:

Try set body padding to 0px and footer margin to 0px and also remove footer left: 0px. That sholud remove white spaces around footer. Take look at this: http://meyerweb.com/eric/tools/css/reset/

Community
  • 1
  • 1
freshbm
  • 5,540
  • 5
  • 46
  • 75