2013-08-06 116 views
0

我正在处理的这个网页的页脚在大多数页面上都贴着底部,除非内容大于“应该”。页脚并非“始终”粘在底部

一个错误页面是:* 一个好的网页是:*

我试图在底部坚持页脚的多种方法,都具有不同的结果。

这是来自Drupal 7.x的Zen starterkit模板。

+0

从'wrapper'移除'height' – Pumpkinpro

回答

2

问题不在于页脚。你有这个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% */ 
} 
+0

感谢您的回应,这是解决方案的一部分。 背景从240px开始,所以顶部240px是白色的,因为我将其更改为固定,它将滚动。它应该从顶部向下填充240px的背景。 所以,页脚问题是固定的,但它会产生另一个问题。 – Thom

+0

问题通过制作头部白色DIV解决,现在位置:固定;背景是用-5的z索引填充整个背景,首页是-1,其余是0。 – Thom