Why hovering in this menu is not working in IE?
Posted
by janoChen
on Stack Overflow
See other posts from Stack Overflow
or by janoChen
Published on 2010-05-11T17:42:40Z
Indexed on
2010/05/11
17:44 UTC
Read the original article
Hit count: 277
When a anchor is hovered in this menu it should turn its background white. It works in Firefox and Chrome but in IE the words just disappear and the background doesn't turn white.
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>
© Stack Overflow or respective owner