1

My footer won't stick to the bottom of the page when there is not enough content, for example, when someone does a search for which there are no results the footer shows in the middle of the screen instead of staying at the bottom of the page.

I've read all the other posts but it seems that the code is different to mine.

This is the footer CSS code:

    .footer {
    padding: 10px 0;
     }

      #footercontainer {
    clear:both; 
    width:100%; 
    position:relative; 
    height:250px;
    bottom:0;

    }
#footer {
    clear:both; 
    padding-top:0px; 
    width:100%; 
    position:absolute; 
    bottom:0;
    left:0;
}

#footer img {
    border:none; 
    text-align:center;
}

#footermiddlecontent {
    width:973px;
     margin-left:auto; 
     margin-right:auto;

     }
#footermiddlecontent p {
    font-size:14px;

    }
#footermiddlecontent a {
    font-size:12px; 
    font-family:arial;

    }
#footerbottom p {
    text-align:center; 
    padding-top:5px; 
    font-size:12px; 
    font-family:arial;

    }
#footerbottom a {
    font-family:arial;

    }
Nat Ritmeyer
  • 5,634
  • 8
  • 45
  • 58
user1678673
  • 9
  • 1
  • 3
  • Please try http://stackoverflow.com/questions/7956787/footer-wont-stick-to-the-bottom-help also http://stackoverflow.com/questions/1488565/how-to-stick-a-footer-to-bottom-in-css I'd recommend avoiding use of javascript in most cases. Please post a skeleton of your code for a fuller answer. – kush Sep 17 '12 at 21:27

3 Answers3

1

It looks like you need to use the CSS Sticky Footer.

desbest
  • 4,746
  • 11
  • 51
  • 84
0

have you tried using position:fixed

atar
  • 98
  • 8
  • Position fixed will fixed the footer to the bottom of the screen, not the result I'm looking for. I'm looking for the footer to always be at the bottom of the page, with or without content, not the screen. – user1678673 Sep 17 '12 at 21:40
0

You need to set the html, body and any other parent element to 100% height. If you could post the rest of your HTML and CSS that makes up the page, I can try to help you more.

Mike
  • 72
  • 1
  • 2
  • 9