2010-05-11 70 views
0

當錨點在這個菜單中盤旋時,它應該將其背景變成白色。它適用於Firefox和Chrome,但在IE中,這些字眼消失,背景不會變白。爲什麼在這個菜單中懸停在IE中不起作用?

(在current anchor link作品在IE只是hover不起作用)

編輯:a:hovercolor屬性在IE工作的問題僅僅是background-color財產。

像下面的圖片: alt text http://img571.imageshack.us/img571/2330/hover.png

下面是當我( 西班牙語在這種情況下)徘徊在IE瀏覽器的鏈接發生什麼: alt text http://img202.imageshack.us/img202/4677/spanishn.jpg

CSS:

#lang { 
    float: right; 
    padding: 0 0 0 0; 
    margin: 50px 25px 0 0; 
    width: 285px; 
} 
#lang li { 
    font-size: 10px; 
    float: right; 
} 
#lang li a#english, #spanish, #chinese { 
    color: #FFF; 
    float: right; 
    padding-right: 20px; 
    padding-top: 2px; 
    padding-bottom: 2px; 
    width: 200px; /* ie fix */ 
} 
#lang li a#english { 
    padding-left: 231px; 
} 
#lang li a#spanish { 
    padding-left: 228px; 
} 
#lang li a#chinese { 
    padding-left: 219px; 
} 
#lang li a:hover { 
background: #FFF; 
color: #444; 
} 
#lang li.current a { 
    background: #FFF !important; 
    color: #444 !important; 
    cursor: default; 
} 

HTML:

<ul id="lang"> 
       <li <?php if($lang_file=='lang.en.php') {echo 'class="current"';} ?>><a id="english" href="index.php?lang=en">english</a></li> 
       <li <?php if($lang_file=='lang.es.php') {echo 'class="current"';} ?>><a id="spanish" href="index.php?lang=es">español</a></li> 
       <li <?php if($lang_file=='lang.zh-tw.php') {echo 'class="current"';} ?>><a id="chinese" href="index.php?lang=zh-tw">中文(繁體)</a></li> 
       <li <?php if($lang_file=='lang.zh-cn.php') {echo 'class="current"';} ?>><a id="chinese" href="index.php?lang=zh-cn">中文(簡體)</a></li> 
      </ul> 
+0

什麼版本的IE瀏覽器? – Adam 2010-05-11 17:49:48

+0

您可以複製和粘貼菜單(ul節點)的源代碼(查看源代碼) – xandercoded 2010-05-11 17:56:54

+0

@Adam我正在使用IE7 – alexchenco 2010-05-11 17:57:02

回答

1
#lang li.current a { 
    background: #FFF !important; /*!important may be causing the issue*/ 
    color: #444 !important;  /*!important may be causing the issue*/ 
    cursor: default; 
} 

也改變:

#lang li a:hover { 
background: #FFF; 
color: #444; 
} 

到:

#lang li a:hover { 
background-color: #FFF; 
color: #444; 
} 
+0

我刪除了!重要的,但我仍然有在IE中懸停的問題 – alexchenco 2010-05-11 17:47:48

+0

@Jano嘗試更改'背景'爲'背景顏色'看看是否有幫助... – xandercoded 2010-05-11 17:53:33

+0

對不起,沒有幫助:( – alexchenco 2010-05-11 17:53:53

0

嘗試使用背景圖像,而不是僅僅一個背景顏色,即使圖像僅僅是一個白色塊重複。我有同樣的問題,谷歌搜索和發現這一點,然後使用圖像修復它;)

相關問題