我正在尝试使用 CSS 构建一个下拉菜单,并且我已经成功隐藏了下拉菜单,但无法让它重新出现。我很确定问题出在 :hover 标签上,我已经从这里的 css 中取出了它,因为我无法让它工作。帮助CSS?请?绝望的。
HTML 代码:
<div id="navigation">
<ul id="menu">
<li class="menu"><a href="#home">Home</a></li>
<li class="menu"><a href="#news">About Us</a></li>
<ul class="sub_menu">
<li>Our Mission Statement</li>
<li>How Funds Are Spent</li>
<ul class="sub_sub_menu">
The Founders
<li>A</li>
<li>B</li>
<li>C</li>
<li>D</li>
<li>E</li>
<li>F</li>
</ul>
</ul>
<li class="menu"><a href="#contact">What We Do</a></li>
<ul class="sub_menu">
<li>T-Shirt Designs</li>
<li>Future Design Ideas</li>
<ul class="sub_sub_menu">
Fact Sheets
<li>How Our Fact Sheets Work</li>
<li>Fact Sheet 1</li>
</ul>
</ul>
<li class="menu"><a href="#about">Media</a></li>
<li class="menu"><a href="#contact">Contact Us</a></li>
</ul>
</div>
CSS如下:
ul {
position: absolute;
list-style-type: none;
margin: 0;
padding: 0;
padding-top: 0px;
padding-bottom: 0px;
}
li.menu {
display: inline
}
a:link, a:visited {
font-weight: bold;
font-size: 14px;
color: #FFFFFF;
background-color: #B4B7BD;
text-align: center;
padding-top: 3px;
padding-bottom: 3px;
padding-right: 20px;
padding-left: 20px;
text-decoration: none;
text-transform: uppercase;
}
a:hover, a:active {
background-color: #B4B7BD
}
ul.sub_menu li {
position: relative;
display: none;
width: 100%;
}
ul.sub_sub_menu {
position: relative;
display: none;
}
ul.sub_sub_menu li {
position: relative;
display: none;
width: 100%;
left: 100%;
}