开发者

Sticky footer, but only sometimes pt. 3

开发者 https://www.devze.com 2023-01-12 14:43 出处:网络
Same issue as before (see Sticky Footer, but only s开发者_JS百科ometimes and Sticky Footer, but only sometimes...continued)...

Same issue as before (see Sticky Footer, but only s开发者_JS百科ometimes and 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消