IE 6 无法识别当前页面

发布于 2024-07-17 15:16:30 字数 2088 浏览 3 评论 0原文

我使用一个简单的列表作为导航,它根据链接的正常、悬停或当前状态显示适当的背景图像。 在 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 忽略。

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

I am using a simple list as navigation which brings up the appropriate background image depending on the state of the link normal, hover or current. In IE6 the current or actual page is being ignored, not displaying the different image and leaving the link active. The code is -

<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>

The CSS for the navigation is -

#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;
}

The #topcontent1 #mainNav ul li a.current style is seemingly being ignored by IE6.

can anyone see an issue or suggest a work around

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

波浪屿的海角声 2024-07-24 15:16:30

IE6 似乎在复杂的选择器语句方面存在问题。 也许尝试使用

#mainNav a.current

而不是

#topcontent1 #mainNav ul li a.current

IE6 seems to have problems with complicated selector statements. maybe try using

#mainNav a.current

instead of

#topcontent1 #mainNav ul li a.current
时光与爱终年不遇 2024-07-24 15:16:30

在您的代码中将其更改

#topcontent1 #mainNav li a:link, #topcontent1 #mainNav li a:visited {

#topcontent1 #mainNav li a {

Change this in your code

#topcontent1 #mainNav li a:link, #topcontent1 #mainNav li a:visited {

to

#topcontent1 #mainNav li a {
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文