2010-05-11 68 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

尝试使用背景图像,而不是仅仅一个背景颜色,即使图像仅仅是一个白色块重复。我有同样的问题,谷歌搜索和发现这一点,然后使用图像修复它;)

相关问题