2011-10-09 109 views
1

我製作了一個圖像庫,能夠正確呈現除IE7以外的任何地方 - http://ianespinoza.com/在IE7中無邊距

我使用的結構如下:

<!-- this div is the overall container for the carousel --> 
<div id="carouselContainer"> 
    <!-- this div contains all the thumbs and this div is animated to slide. --> 
    <div id="thumbContrainer"> 
     <ul class="thumb"> 
     <!-- Img 1 --> 
     <li>...</li> 
     etc.... 
     </ul 
    </div> 
</div> 

這裏是應用於這些元素的樣式:

#carouselContainer { 
width:934px; 
height:145px; 
border:none; 
overflow:hidden; 
position:relative; 
left:40px; 
top:5px;} 


#thumbContrainer { 
position:relative; 
left:20px; 
height:110px; 
margin:30px 0px; 
width:5000px; 
border:none;} 

ul.thumb { 
list-style: none; 
margin: 0; 
padding: 0px;} 

所有正確呈現在所有瀏覽器,除了IE7。

在IE 7 div「thumbContrainer」沒有上邊距,但我真的需要這個邊距。

+1

你忘了把#放在thumbContainer之前。 – punit

回答

1

感謝所有的答案和建議。

事實上,我最終修復IE7問題的方式是給父元素 - 「carouselContainer」填充填充,並刪除「thumbContrainer」的邊距。

雖然它解決了這個問題,但仍然不確定與原來設置的是什麼,即使使用* margin-top也沒有幫助。

+0

你是如何修復它的? – Muhammed

+0

Athimannil,老實說,我不記得以上說過了,因爲它是幾年前。抱歉。 – hanazair

1

嘗試在#thumbContrainerpadding更換margin

#thumbContrainer{ 
    position:relative; 
    left:20px; 
    height:110px; 
    padding:30px 0px; 
    width:5000px; 
    border:none; 
}