粘性页脚,但只是有时 pt。 3
与以前相同的问题(请参阅粘性页脚,但只是有时和粘性页脚,但只是有时...继续)...
我有一个我想要的页脚坚持到页面底部,除非内容填满页面,然后我希望它被推下。我已经在其他网站上这样做过十几次了,但我无法让这个网站工作。在 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;
}
站点:
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:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用的配方是:
html
上的height: 100%
min-height: 100%
和position:relative
body
(对于 ie6 为height:100%
)position:absolute
和bottom:0
不过,防止页脚遮盖底部附近的一些文本可能很棘手。The recipe I use is:
height: 100%
onhtml
min-height: 100%
andposition: relative
onbody
(withheight:100%
for ie6)position: absolute
andbottom: 0
on the footer divMaybe be tricky preventing footer from obscuring some text near the bottom though.