2013-07-05 40 views
0

請使用IE8瀏覽本網站Here。您可能會注意到底部的某些圖標兩側都有箭頭。行內塊與ie8不兼容?

在本地,箭頭出現在任何一邊,但它們被擠壓到大約10個像素,並且它們應該是60px乘44px。在服務器上查看時,它們不會出現擠壓現象,但它們位於圖標的上方和下方。不知道去哪裏這個方向。

在Chrome中查看時,它們顯示正常,並且它們位於3個圖標的任一側,因爲它們應該是。他們都搞砸了IE8。我一直在玩這個CSS(內聯塊),無濟於事。

#nav_arrow { 
    display: inline-block !important; 
    } 

下面是該區域的HTML ...

<p align="center"> 

     <div id="nav_arrow"> 
     <a href="index.html"><img src="images/icons/arrow_left.png" width="60" height="44"></a> 
      <img src="images/spacer-10px.png"></div> 

     <a href="index.html"><img src="images/icons/home_75x75.png" alt="" title="Welcome!"></a> 
      <img src="images/spacer-10px.png"> 

     <a href="national_presence.html"><img src="images/icons/locations_75x75.png" alt="" title="Our Locations!"></a> 
      <img src="images/spacer-10px.png"> 

     <a href="accreditation.html"><img src="images/icons/accreditation_75x75.png" alt="" title="Our Accreditation!"></a> 
      <img src="images/spacer-10px.png"> 

     <div id="nav_arrow"> 
     <a href="accreditation.html"><img src="images/icons/arrow_right.png" width="60" height="44"></a> 
      <img src="images/spacer-10px.png"></div> 


    </p> 

我試圖走動的標籤,在一個容器包裝的一切,改變了文檔類型,但我已經沒有運氣。

有什麼想法?

+1

是啊....即吸 –

回答

2

試試這個:

#nav_arrow { 
    display: inline; 
    zoom: 1; 
} 
+0

好的。我做到了,它工作。但是它做了什麼。什麼是縮放屬性? – webfrogs

+0

我不知道,但我看到這裏: http://stackoverflow.com/questions/14898928/ie8-and-below-inline-block-css 你必須搜索更多!請標記我的答案已解決,謝謝。 ;) – Seazoux

+1

如果你在其他地方找到了答案stackoverflow你應該剛剛添加,作爲對這個問題的評論,特別是因爲你的答案不能解釋爲什麼添加'zoom:1'修復問題!同樣要求答案被標記爲已解決的問題應該被避免。很明顯,@ JaredNewnam已經接受了以前的問題,所以知道它是如何工作的。 – andyb

1

罪魁禍首是某人意外:

img { max-width: 100%; 

IE 8的表現比max-width上的圖像其他瀏覽器不同。這是值得看的規格:

If the containing block's width depends on this element's width, then the 
resulting layout is undefined in CSS 2.1. 

這是這裏的情況。所以公平地說,IE並不完全錯誤。

建議的修復

display: inline; 
zoom: 1; 

爲IE < 8.一劈的結果是類似於display: inline-block。在IE 7兼容模式下,圖像上的max-width按預期工作,這是一個愉快的巧合。也許在IE 7中,我不知道。所以你用這種黑客觸發IE 7渲染模式,這就是它的原因。