2009-05-19 204 views
1

我需要頁面底部的頁腳,它與使頁面滾動的任何內容重疊。而且,當向下滾動時,頁腳仍然需要停留在那裏。固定底部對齊Div

這可能與CSS只適用於IE6 +?

+0

可能的重複[CSS唯一技術的固定底部頁腳高度可變,沒有表,不重疊](http://stackoverflow.com/questions/29835813/css-only-technique-for-a-fixed- bottom-footer-with-variable-height-no-tables-no) – imme 2015-11-10 03:59:23

回答

0

編輯:因爲IE6不支持position:fixed;這裏是a good workaround

+0

position:固定不支持IE6,所以這是行不通的。 – peirix 2009-05-19 11:25:27

+0

好的,感謝您的更正,將您的解決方法投給了...... – 2009-05-19 14:51:13

1

做一個快速的谷歌搜索CSS頁腳,你會發現很多解決方案。但是,大多數的解決方案似乎是這樣的工作:

<body> 
    <div id="wrapper"> 
    Main content 
    </div> 
    <div id="footer"> 
    Footer content 
    </div> 
</body> 

,然後應用CSS:

body, html { height: 100% } 
#wrapper { height: 100% } 
#footer { 
    height: 150px; 
    margin-top: -150px; 
} 
6

最近我用下面的風格:

div.BottomDisclaimer 
{ 
    z-index:100; 
    position:fixed; 
    bottom:0px; 
    border-top-style: solid; 
    border-top-width: 1pt; 
    padding-top: 4px; 
} 
0

對於IE6,這是不可能的使用position:fixed。如果需要,可以使用Dean Edwards的IE7 library來獲得該行爲。