2012-06-29 24 views
1

無法爲ie7中的DOM元素提供z-index解決方案。 確定這是真實的標記:ie7中的z-index不起作用

<div id="page-wrap"> 
<div class="push"></div> 
<footer id="footer-container" class="source-org vcard copyright"> 
<div class="grass"></div> 
<div id="footer"></div> 
</footer> 

這裏CSS:

#page-wrap { 
    height: auto !important; 
    margin: 0 auto -60px; 
    min-height: 100%; 
    position: relative; 
    width: 98%; 
} 
.push { 
    height: 60px; 
} 
#footer-container { 
    background-color: #1B1B1B; 
    bottom: 0; 
    height: 60px; 
    position: relative; 
    width: 100%; 
} 
.grass { 
    background-image: url("assets/images/grass.png"); 
    background-repeat: repeat-x; 
    height: 82px; 
    position: absolute; 
    top: -78px; 
    width: 100%; 
} 
article, aside, figure, footer, header, hgroup, nav, section { 
    display: block; 
} 
#footer { 
    margin: auto; 
    position: relative; 
    top: 20px; 
    width: 960px; 
} 

希望它能幫助。 其實thi在所有瀏覽器上工作正常,即使ie9和ie8。

+0

你可以發佈的CSS? – boyd

+0

你想達到什麼目的?你的CSS是什麼樣的? – Kaivosukeltaja

回答

3

那麼你沒有提供足夠的代碼和使用z-index,所以我的邏輯猜測是ie7的問題是錯誤的z-索引解釋。爲了解決您的問題,請爲您想要的元素提供負Z指數。例如,

<div style="z-index:-1;" id="beneath"></div> 
<div style="z-index:1;" id="above"></div> 

會工作,但,

<div style="z-index:0;" id="beneath"></div> 
<div style="z-index:1;" id="above"></div> 

將無法​​在IE7中工作。

所以,使其工作在下面給出負值(*任何你想要的「下面」)DIV

0

我發現了一些神祕IE
IE不能讀取的z-index值超過1000