如何修复 ie 6 悬停问题?
这是我的菜单代码:
/*Menu*/
#menu {
text-align: right;
margin-left: auto;
margin-right: auto;
height: 50px;
position: relative;
z-index: 5;
font-size: 0.75em;
}
#menu ul {
margin: 0;
padding: 10px 5px 5px 5px;
list-style: none;
line-height: normal;
border: 0px solid #03426A;
-moz-border-radius: 6px;
background: #F3F4FF;
position:relative;
width: auto;
float:right;
}
#menu ul li {
float: left;
}
#menu li ul {
display: none;
}
#menu ul li a {
display: block;
text-decoration: none;
color: #000;
display: block;
padding: 0px 15px 5px 15px;
text-decoration: none;
text-align: center;
font-size: 1em;
font-weight: normal;
border: none;
}
#menu ul li a:hover {
color: #0A67A3;
}
#menu li:hover ul {
display: block;
position: absolute;
}
#menu li:hover li {
float: none;
font-size: 0.9em;
}
#menu li:hover a { color: #0A67A3; }
#menu li:hover li a:hover { color: #000; }
/*End Menu*/
我已经尝试了 2 个教程,但是还没有找到使菜单在 ie 5.5 或 6 中工作的方法。我该如何解决这个问题?
This is my code for my menu:
/*Menu*/
#menu {
text-align: right;
margin-left: auto;
margin-right: auto;
height: 50px;
position: relative;
z-index: 5;
font-size: 0.75em;
}
#menu ul {
margin: 0;
padding: 10px 5px 5px 5px;
list-style: none;
line-height: normal;
border: 0px solid #03426A;
-moz-border-radius: 6px;
background: #F3F4FF;
position:relative;
width: auto;
float:right;
}
#menu ul li {
float: left;
}
#menu li ul {
display: none;
}
#menu ul li a {
display: block;
text-decoration: none;
color: #000;
display: block;
padding: 0px 15px 5px 15px;
text-decoration: none;
text-align: center;
font-size: 1em;
font-weight: normal;
border: none;
}
#menu ul li a:hover {
color: #0A67A3;
}
#menu li:hover ul {
display: block;
position: absolute;
}
#menu li:hover li {
float: none;
font-size: 0.9em;
}
#menu li:hover a { color: #0A67A3; }
#menu li:hover li a:hover { color: #000; }
/*End Menu*/
I have tried 2 tutorials however have not found a way of making the menu work in ie 5.5 or 6. How can I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
IE6 不支持锚标记以外的元素上的 :hover 伪类。 Son of Suckerfish 有一个可能适合您的解决方案: http://www.htmldog.com/文章/suckerfish/dropdowns/
IE6 doesn't support :hover pseudoclass on elements other than anchor tags. Son of Suckerfish has a solution that may work for you: http://www.htmldog.com/articles/suckerfish/dropdowns/
IE 5.5?真的...哇,如果您仍然需要兼容那么远,我为您感到遗憾...我想是传统的企业应用程序?该死!!
IE6 只能理解
元素的
:hover
,这是肯定的。但是您可以尝试此处给出的解决方案,该解决方案使用 htc 文件创建新的 css 行为: http: //www.xs4all.nl/~peterned/csshover.htmlIE 5.5? Really... Wow I feel sorry for you if you need to still be compatible that far...Legacy corporate app I suppose? Damn!!
IE6 only understands
:hover
for<a>
elements that's for sure. But you can try the solution given here that uses a htc file to create a new css behavior: http://www.xs4all.nl/~peterned/csshover.html