IE 6 无法识别当前页面
我使用一个简单的列表作为导航,它根据链接的正常、悬停或当前状态显示适当的背景图像。 在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
IE6 似乎在复杂的选择器语句方面存在问题。 也许尝试使用
而不是
IE6 seems to have problems with complicated selector statements. maybe try using
instead of
在您的代码中将其更改
为
Change this in your code
to