views:

26

answers:

1

Same issue as before (see http://stackoverflow.com/questions/3118932/sticky-footer-but-only-sometimes and http://stackoverflow.com/questions/3119399/sticky-footer-but-only-sometimes-continued)...

I have a footer that I want to stick to the bottom of the page unless content fills the page, then I want it to get pushed down. I've done this a dozen times with other sites, but I can't get this one to work. Working in Wordpress. I've checked the order of my divs and I've gone over the css...any help is appreciated.

The main css components:

* {
    margin: 0;
    padding: 0;
}

html, body {
    height:100%;
    min-height:100%;
}

#wrapper {
    background:url("images/shadowborder.png") repeat-y center;
    width:100%;
        max-width:100%;
        min-width:980px;
    min-height:100%!important;
        margin:0 auto;
    margin-bottom:-20px;
    position:relative;
    overflow:auto;
}

#content {
    clear:both;
    float:left;
    padding:20px 20px 60px 20px;
    font-size: 1.6em
}
#spacer {
    height: 40px;
    clear: both;
}

#footer {
    position: relative;
    border-top: 1px solid #e5a5fc;
    padding:3px!important;
    height:20px;
}

The site:

http://www.hcfmissoula.com

A: 

The recipe I use is:

  • height: 100% on html
  • min-height: 100% and position: relative on body (with height:100% for ie6)
  • position: absolute and bottom: 0 on the footer div

Maybe be tricky preventing footer from obscuring some text near the bottom though.

Radomir Dopieralski
http://www.cssstickyfooter.com/ this is the one I use. It's always been good to me...
blackessej
until now, that is ;)
blackessej