我正在处理的这个网页的页脚在大多数页面上都贴着底部,除非内容大于“应该”。页脚并非“始终”粘在底部
一个错误页面是:* 一个好的网页是:*
我试图在底部坚持页脚的多种方法,都具有不同的结果。
这是来自Drupal 7.x的Zen starterkit模板。
我正在处理的这个网页的页脚在大多数页面上都贴着底部,除非内容大于“应该”。页脚并非“始终”粘在底部
一个错误页面是:* 一个好的网页是:*
我试图在底部坚持页脚的多种方法,都具有不同的结果。
这是来自Drupal 7.x的Zen starterkit模板。
问题不在于页脚。你有这个CSS,在#wrapper
和#subwrapper
元素上强制1100px的高度,这就是为什么它看起来像在页脚“下面”。
#wrapper{
position: absolute;
left: 0px;
top: 240px;
width: 100%;
height: 1100px; /* This is making the page longer than it should be.*/
background: #85bb99;
z-index: -5;
}
#wrapper #subwrapper {
background: url('/themeimages/pattern-cutout.png');
opacity: 0.2;
width: 100%;
height: 1100px; /* Same thing here */
}
它看起来像你正在使用这些元素作为背景图像。你可以通过尝试这个CSS来修复它:
#wrapper{
position: fixed; /* Use fixed positioning so it'll always be displayed */
left: 0px;
width: 100%;
height: 100%; /* Set a height of 100% */
background: #85bb99;
z-index: -5;
}
#wrapper #subwrapper {
background: url('/themeimages/pattern-cutout.png');
opacity: 0.2;
width: 100%;
height: 100%; /* Set a height of 100% */
}
从'wrapper'移除'height' – Pumpkinpro