2012-11-19 71 views
1

在所有瀏覽器中,我的導航顯示效果都很好,如chrome,firefox,opera,safari。IE偏移導航問題

但由於某種原因,即拒絕正確顯示,更令人沮喪的是它實際上是1px。

通常不會打擾我,但它是在一個地方,這是很明顯的:

即:

enter image description here

其他瀏覽器:

enter image description here

代碼我使用似乎很好,但這裏是:

nav { 
font-family: "Myriad Pro", Arial, sans-serif; 
width: 280px; 
height: 40px; 
float: right; 
font-size: 14px; 
list-style: none; 
clear: both; 
position: relative; 
top: 11px; 
} 

nav ul { 
float: right; 
margin: 0; 
height: 40px; 
    width:240px 
} 

nav li { 
display: inline; 

} 

nav li a { 
color: #3BB9FF; 
border-bottom: none; 
padding: 12px 10px 11px 10px; 
margin-left: -3px; 
} 

nav li a:hover{ 
color: #3BB9FF; 
background-color: rgba(0, 0, 0, 0.3); 
} 



/******** 
Shows which page is selected 
*/ 

nav li.selected { 
display: inline; 
} 


nav li a.selected { 
color: #3BB9FF; 
background-color: rgba(200, 200, 200, 0.3); 
border-top: 3px solid #fff; 

} 

我使用ie ie html5 shim從谷歌樹幹也。

這個問題的任何簡單的修復?我知道這不是什麼大不了的事情,只是令人沮喪。

+0

您是否添加了<!DOCTYPE html> – Enve

+0

@恩,是的,我確實。 – samayres1992

+0

你可以給HTML代碼或創建jsFiddle演示。 – Enve

回答

0

菜單上的CSS代碼有點奇怪。我認爲這就是爲什麼IE正在採取行動。 請嘗試以下調整:

nav li { 
    //display: inline; 
    float:left; 
} 
nav li a { 
    color: #3BB9FF; 
    border-bottom: none; 
    //padding: 12px 10px 11px 10px; 
    //margin-left: -3px; 
    display:block; 
    padding:10px; 
} 

同時檢查菜單在IE寬度不夠。