2013-08-06 111 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