粘性页脚,但只是有时 pt。 3

发布于 2024-09-15 15:50:29 字数 1164 浏览 4 评论 0原文

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

我有一个我想要的页脚坚持到页面底部,除非内容填满页面,然后我希望它被推下。我已经在其他网站上这样做过十几次了,但我无法让这个网站工作。在 WordPress 中工作。我已经检查了 div 的顺序,并且已经检查了 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

Same issue as before (see Sticky Footer, but only sometimes 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

此生挚爱伱 2024-09-22 15:50:29

我使用的配方是:

  • html 上的 height: 100%
  • min-height: 100%position:relative body(对于 ie6 为 height:100%
  • 页脚 div 上的

position:absolutebottom:0不过,防止页脚遮盖底部附近的一些文本可能很棘手。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文