这是我正在开发的网站:http: //argumentinamerica.com/
菜单是这样的:
<div id="menu">
<ul id="menu">
<li><a href="#"><span></span>Home</a></li>
<li class='has-sub'><a href="#"><span></span>Units</a>
<ul>
<li class='has-sub'><a href="#">Unit 1</a></li>
<ul>
<li><a href="#">Read About It</a></li>
<li><a href="#">Write About It</a></li>
<li><a href="#">Hear About It</a></li>
<li><a href="#">Speak About It</a></li>
<li><a href="#">Read About It</a></li>
<li><a href="#">Write About It</a></li>
</ul>
<li class='has-sub'><a href="#">Unit 2</a></li>
<li class='has-sub'><a href="#">Unit 3</a></li>
<li class='has-sub'><a href="#">Unit 4</a></li>
<li class='has-sub'><a href="#">Unit 5</a></li>
</ul>
<li><a href="#"><span></span>Teacher Center</a></li>
<li><a href="#"><span></span>About</a></li>
<li><a href="#"><span></span>Give 1</a></li>
</ul>
</div>
CSS是这样的:
#menu {
margin: 0; padding: 2px 0px 2px 0px;
list-style-type: none;
height: 2.4em;
}
#menu ul, #menu li, #menu span, #menu a {
margin: 0;
padding: 0;
position: relative;
}
#menu li {
float: left;
width: 20%;
}
#menu a {
display: block;
margin: 1px;
height: 2.4em;
font-size: 10px;
line-height: 2.4em;
text-decoration: none;
text-transform: uppercase;
text-align: center;
background: #ffcc66;
color: #996600;
}
#menu span {
position: absolute; top: 8px; left: 8px;
width: 8px; height: 8px;
background: #ff9933;
}
#menu a:hover {
background: #cc3300;
color: #ffcc66;
}
#menu ul{
list-style-type: none;
}
#menu .has-sub {
z-index: 1;
}
#menu .has-sub:hover > ul {
display: list-item;
}
#menu .has-sub ul {
display: none;
position: absolute;
left:0;
}
#menu .has-sub ul li {
*margin-bottom: -1px;
position: relative;
width: 100%;
height: 2.6em;
line-height: 2.4em;
}
#menu .has-sub ul li a {
background: #ff9944;
font-size: 11px;
color: ffcc66;
}
#menu .has-sub ul li:hover a {
background: #ff6633;
color: 993300;
}
#menu .has-sub {
z-index: 1;
}
#menu .has-sub:hover > ul {
display: list-item;
}
#menu .has-sub .has-sub ul {
display: none;
position: absolute;
left:0;
}
#menu .has-sub .has-sub ul {
display: none;
position: absolute;
left:0;
}
#menu .has-sub .has-sub ul li {
*margin-bottom: -1px;
position: relative;
width: 100%;
height: 2.6em;
line-height: 2.4em;
}
#menu .has-sub .has-sub ul li a {
background: #ff9944;
font-size: 11px;
color: ffcc66;
}
#menu .has-sub .has-sub:hover > ul {
display: block;
}
#menu .has-sub .has-sub ul li:hover a {
background: #ff6633;
color: 993300;
}
第三层在 Units: Unit 1 下。
我查看了Displaying third tier submenus proper with css only menu and https://stackoverflow.com/questions/13775342/adding-third-tier-to-drop-down-menu和DropDown Menu won't to display on hover and a许多其他问题试图找出问题所在,但我仍然无法显示第三层。我真的很感激有人看一看并告诉我我错过了什么。