css - IE 6 无法识别当前页面

标签 css internet-explorer internet-explorer-6 navigation

我使用一个简单的列表作为导航,它根据链接的正常、悬停或当前状态显示适当的背景图像。在 IE6 中,当前或实际页面被忽略,不显示不同的图像并使链接保持事件状态。代码是——

<div id="mainNav">
  <ul>
    <li><a href="../index.html">Home</a></li>
    <li><a href="../work.html" class="current">Projects</a></li>
    <li><a href="../contact.html">Contact</a></li>
  </ul>
</div>

导航的 CSS 是 -

#topcontent1 #mainNav {
    position: absolute;
    left: 86px;
    width: 328px;
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size: 0.9em;
    padding: 0px;
    clear: both;
    color: #666633;
    margin-right: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
    font-weight: 700;
    text-transform: uppercase;
}
#topcontent1 #mainNav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    float: left;
    width: 100%;
}
#topcontent1 #mainNav li {
    float: left;
    margin: 0;
    padding:0;
    display: block;
}
#topcontent1 #mainNav li a:link, #topcontent1 #mainNav li a:visited {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size: 1em;
    color: #fff;
    text-decoration: none;
    display: block;
    background-repeat: no-repeat;
    margin-right: 10px;
    width: 99px;
    height: 62px;
    margin-top: 0px;
    line-height: 62px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0;
    text-align: center;
    padding-top: 60px;
    background-image: url('../images and html/images/tabnorm.jpg');
}
#topcontent1 #mainNav li a:hover {
    color: #f8b449;
    border: none;
    background-image: url('../images and html/images/tabhover.jpg');
    background-repeat: no-repeat;
}
#topcontent1 #mainNav ul li a.current {
    color: #AAB3B2;
    background-image: url('../images and html/images/tabcurr.jpg');
    background-repeat: no-repeat;
}
#topcontent1 #mainNav ul li a.current:hover {
    color: #AAB3B2;
    cursor: default;
}

#topcontent1 #mainNav ul li a.current 样式似乎被 IE6 忽略了。

任何人都可以看到问题或建议解决方法

最佳答案

IE6 似乎对复杂的选择器语句有问题。也许尝试使用

#mainNav a.current

代替

#topcontent1 #mainNav ul li a.current

关于css - IE 6 无法识别当前页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/770583/

相关文章:

css - 使用 text-align justify/text-justify and right 时的奇怪行为

internet-explorer - 通过 iron-router 导航到另一个页面后,Meteor Session 在 IE 9 中重置

javascript - jQuery - 脚本在 IE6 中应用缓慢 : Can anything be done?

Javascript提示-数据隐藏在ie中

javascript - 这些天程序员如何处理 ie6 错误?

css - 使用 css 对齐配置文件字段

php - Codeception - 如何处理具有非唯一名称的字段

javascript - 有没有一种方法可以检测 Firefox 是否会在 IE 选项卡中打开特定的 URL?

html - 如何仅将 CSS 样式应用于 div 而不是 before 伪元素

html - 如何使用-webkit-transform : rotateX(); 使隐藏的面孔从顶部出现