【发布时间】:2010-12-05 10:11:38
【问题描述】:
我一直致力于使用纯 CSS 建立和运行菜单。除了 IE6,我已经在所有浏览器中都可以使用它。这是我的 CSS。
/**~**~**~**~**~**~**~**~**~**~**~**~**~**~**~**~**
NAVIGATION MENUS
~**~**~**~**~**~**~**~**~**~**~**~**~**~**~**~**~**/
#topNavigation
{
width: 750px;
background-color: #EC2327;
float: left;
position: absolute;
z-index: 10;
}
#footerBar
{
float: left;
width: 750px;
background-color: #EC2327;
}
#topNavigation ul, #footerBar ul
{
list-style: none;
margin: 0;
padding: 0;
width: 6em;
float: left;
}
#topNavigation a, #topNavigation h2, #footerBar a
{
font-family: Verdana;
font-size: 12px;
font-weight: normal;
color: White;
text-align: center;
display: block;
margin: 0;
padding: 2px 3px;
text-decoration: none;
}
#topNavigation h2
{
}
#topNavigation a
{
color: White;
background-color: #EC2327;
}
#topNavigation a:hover
{
color: #EC2327;
background-color: White;
}
#topNavigation ul ul
{
display: none;
position: absolute;
width: auto;
z-index: 500;
}
#topNavigation ul li:hover ul
{
display: block;
}
这里有一些使用这种 CSS 的 HTML。
<div id="topNavigation">
<ul>
<li><h2><a href="#">About Us</a></h2>
<ul>
<li><a href="#">Company Profile</a></li>
<li><a href="partners.aspx">Partner's Page</a></li>
<li><a href="testimonials.aspx">Testimonials</a></li>
<li><a href="#">Environmental</a></li>
</ul>
</li>
</ul>
</div>
问题是在 IE6 中菜单不会被击落。虽然我能拿到顶级
谢谢, 迈克
【问题讨论】:
标签: asp.net html css internet-explorer-6 menu