0

与以前相同的问题(请参阅粘页脚,但仅有时粘页脚,但仅有时...继续)...

我有一个页脚,我想贴在页面底部,除非内容填满页面,然后我希望它被向下推。我已经在其他网站上做了十几次,但我无法让这个工作。在 WordPress 中工作。我已经检查了我的顺序,divs并且我已经检查了 css ......任何帮助表示赞赏。

主要的css组件:

* {
    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;
}

网站:

http://www.hcfmissoula.com

4

1 回答 1

0

我使用的食谱是:

  • height: 100%html
  • min-height: 100%position: relative打开bodyheight:100%用于 ie6)
  • position: absolutebottom: 0在页脚 div

不过,防止页脚遮挡底部附近的一些文本可能会很棘手。

于 2010-08-23T20:56:14.700 回答