Suckerfish 之子 CSS 导航菜单在 IE7 中不起作用
无法用语言表达我的沮丧,我无法让 IE7 中的下拉菜单在父项下对齐。它们适用于所有其他浏览器 ~ 包括 IE8 ~ 但 IE7...
菜单的下拉部分显示在 ie7 中父项的右侧。
有人可以帮忙吗?
这是 css:
/* ----------------------------------- navigation ----------------------------------------- */
/* ----------------------------------- main ----------------------------------------- */
#mainnav ul, #mainnav ul li, #mainnav ul li a {display:block;float:left;list-style:none;width:100%;margin:0;padding:0;}
#mainnav ul li {
width:auto;
}
#mainnav ul li a {
width:auto;
color:#000;
text-decoration:none;
font: 400 14pt/52px 'Crimson Text', serif;
text-transform: uppercase;
overflow:hidden;
display:block;
float:left;
}
#mainnav ul li a span {
display:inline;
float:left;
cursor:pointer;
overflow:hidden;
padding:0px 18px 0px 0px;
margin: 0px 0px 0px 18px;
}
#mainnav ul li:hover, #mainnav ul li a:hover, #mainnav ul li.active a {
color:#fff;
background:transparent url(/assets/images/layout/nav-button-sprite.png) no-repeat top left;
}
#mainnav ul li:hover a span, #mainnav ul li a:hover span, #mainnav ul li.active a span {
background:transparent url(/assets/images/layout/nav-button-sprite.png) no-repeat right top;
color:#fff;
}
/* ----------------------------------- navigation ----------------------------------------- */
/* ----------------------------------- drop downs ----------------------------------------- */
#mainnav ul li ul { /* second-level lists */
position: absolute;
background: url(/assets/images/layout/drop-down-seventy-percent.png) repeat;
width: 208px;
top:52px;
float:left;
left: -9999em; /* using left instead of display to hide menus because display: none isn't read by screen readers */
}
#mainnav ul li ul li a,
#mainnav ul li ul li a span,
#mainnav ul li ul li a:hover,
#mainnav ul li ul li a:hover span {
padding:0;
margin:0;
background-image:none;
color:#fff;
font: 12px/16px Arial, Helvetica, sans-serif;
text-transform: capitalize;
}
#mainnav ul li ul li a,
#mainnav ul li ul li a span {background-image:none !important;}
#mainnav ul li ul li a span, #mainnav ul li ul li a:hover span {width:200px;padding:4px 0px 4px 8px;}
#mainnav ul li ul li a:hover span {background-color:#88273c;}
#mainnav ul li:hover ul, #mainnav ul li.sfhover ul {
left: auto;
}
这是 html:
<div id="mainnav">
<ul>
<li class="first level-1"><a href="http://ccsind.com/"><span>Home</span></a></li>
<li class="level-1"><a href="about-us/"><span>About Us</span></a>
<ul>
<li class="first level-2"><a href="about-us/what-we-do.html"><span>What We Do</span></a></li>
</ul>
</li>
</ul>
</div>
太沮丧了...... -肖恩
Frustrated beyond all words, I am having trouble getting the drop downs in IE7 to line up under the parent item. They work in every other browser ~ including IE8 ~ but IE7...
The drop down part of the menu displays off to the right of the parent item in ie7.
can anyone help?
Here is the css:
/* ----------------------------------- navigation ----------------------------------------- */
/* ----------------------------------- main ----------------------------------------- */
#mainnav ul, #mainnav ul li, #mainnav ul li a {display:block;float:left;list-style:none;width:100%;margin:0;padding:0;}
#mainnav ul li {
width:auto;
}
#mainnav ul li a {
width:auto;
color:#000;
text-decoration:none;
font: 400 14pt/52px 'Crimson Text', serif;
text-transform: uppercase;
overflow:hidden;
display:block;
float:left;
}
#mainnav ul li a span {
display:inline;
float:left;
cursor:pointer;
overflow:hidden;
padding:0px 18px 0px 0px;
margin: 0px 0px 0px 18px;
}
#mainnav ul li:hover, #mainnav ul li a:hover, #mainnav ul li.active a {
color:#fff;
background:transparent url(/assets/images/layout/nav-button-sprite.png) no-repeat top left;
}
#mainnav ul li:hover a span, #mainnav ul li a:hover span, #mainnav ul li.active a span {
background:transparent url(/assets/images/layout/nav-button-sprite.png) no-repeat right top;
color:#fff;
}
/* ----------------------------------- navigation ----------------------------------------- */
/* ----------------------------------- drop downs ----------------------------------------- */
#mainnav ul li ul { /* second-level lists */
position: absolute;
background: url(/assets/images/layout/drop-down-seventy-percent.png) repeat;
width: 208px;
top:52px;
float:left;
left: -9999em; /* using left instead of display to hide menus because display: none isn't read by screen readers */
}
#mainnav ul li ul li a,
#mainnav ul li ul li a span,
#mainnav ul li ul li a:hover,
#mainnav ul li ul li a:hover span {
padding:0;
margin:0;
background-image:none;
color:#fff;
font: 12px/16px Arial, Helvetica, sans-serif;
text-transform: capitalize;
}
#mainnav ul li ul li a,
#mainnav ul li ul li a span {background-image:none !important;}
#mainnav ul li ul li a span, #mainnav ul li ul li a:hover span {width:200px;padding:4px 0px 4px 8px;}
#mainnav ul li ul li a:hover span {background-color:#88273c;}
#mainnav ul li:hover ul, #mainnav ul li.sfhover ul {
left: auto;
}
and here is the html:
<div id="mainnav">
<ul>
<li class="first level-1"><a href="http://ccsind.com/"><span>Home</span></a></li>
<li class="level-1"><a href="about-us/"><span>About Us</span></a>
<ul>
<li class="first level-2"><a href="about-us/what-we-do.html"><span>What We Do</span></a></li>
</ul>
</li>
</ul>
</div>
so frustrated....
-sean
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
left: auto
更改为left: 0
:并添加
position:relative
:Change
left: auto
toleft: 0
:and add
position: relative
: