2014-01-27 35 views
-1

我想要在頁面底部獲得經典頁腳。這個想法是,頁眉和頁腳不被固定,以最大化內容屏幕。它必須在IE8中工作,但下面的代碼不起作用。錯誤的部分是,IE留下<footer>以下的空白,雖然在Firefox中工作正常。非固定頁腳在底部,在頁面中的非固定頁眉在IE8中

html, body 
{ 
    height: 100%; 
} 

header 
{ 
    height: 50px; 
    margin-bottom: 22px; 
} 

#content 
{ 
    box-sizing: border-box; 
    min-height: 100%; 
    height: auto; 
    margin-top: -72px; /* To avoid white space below footer. Works in FF, but not in IE*/ 
    padding-top: 72px; 
} 

footer 
{ 
    clear: both; 
    height: 30px; 
    background: #222; 
    margin-top: -30px; 
} 

的HTML代碼是非常標準:

<body> 
    <header>...</header> 
    <div id="content">...</div> 
    <footer>...</footer> 
</body> 

有沒有辦法堅持在底部頁腳沒有它在IE8固定?

P.S.我使用HTML5Shiv爲<header><footer>

+0

但是那不是語義錯誤? – Eagle

+0

是的,我想我有一個腦屁,把頭標與頭標混在一起。 oops – snaplemouton

回答