我正在處理的這個網頁的頁腳在大多數頁面上都貼着底部,除非內容大於「應該」。頁腳並非「始終」粘在底部
一個錯誤頁面是:* 一個好的網頁是:*
我試圖在底部堅持頁腳的多種方法,都具有不同的結果。
這是來自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