2013-08-23 24 views
0

我剛剛完成一個小網站,並在IE7中發現的標誌是隱藏在主頁上的圖像背後:http://reapvalue.com/爲什麼該標識隱藏在IE7中?

下面是HTML:

<div id="wrap"> 
    <div id="header"> 
    <ul id="main-nav"> 
    <li><a href="/about/">About</a></li> 
    <li><a href="/what-we-do/">What We Do</a></li> 
    <li class="last"><a href="/contact/">Contact</a></li> 
</ul> 

<h1><a href="/"><img id="logo" src="/photos/logo.png" alt="REAP - Renewable Energy and Preservation, April Montgomery, LLC." ></a></h1> 
<h1><a href="/"><img id="logo-small" src="/photos/logo-small.png" alt="REAP - Renewable Energy and Preservation, April Montgomery, LLC." ></a></h1> 
    </div><!-- end #header --> 
    <div id="tagline"> 
     <span class="green">renewable energy</span> <span class="magenta">and preservation</span> 
    </div> 

    <div id="main" class="clearfix"> 

     <div id="Stage" class="EDGE-909290339"></div> 

      <img id="lead-image" src="photos/hickory.jpg" alt="hickory, nc preserveration district"> 

這裏是CSS:

#header   { width: 960px; height: 53px; margin: 0 auto; position: relative; } 
body#inside #header { height: 56px; } 
img#logo  { position: absolute; top: 0; left: 0; z-index: 5000; } 

儘管z-index的設置爲5000仍然隱藏背後的形象。任何幫助將徽標置於前面的幫助將不勝感激。

謝謝。

+0

老的IE有時不會正確適用的z-index。嘗試將'position:relative'添加到您的'img#徽標'中。 – hallaji

回答

1

我真的不能解釋爲什麼,但是Z-指數IE7和IE8的行爲怪異。 如果您使用的z-index,並希望它在舊的ie瀏覽器工作,你需要確保你的父元素具有heigher的z-index那麼你的元素。

例如,給你一個#headerz-index: 6000;它會被修復。

我希望有人可以給你一個更好的解釋,爲什麼這個作品,因爲我想知道自己藏漢。

編輯:我升技一派,發現這個有趣的帖子:

http://www.brenelz.com/blog/squish-the-internet-explorer-z-index-bug/