我正在尝试实现子菜单效果,其中用户将鼠标悬停在常见问题解答链接上,子菜单下拉并显示其他两个选项-但我似乎什至无法正确获取 HTML(更不用说 jQuery),谁能帮忙我出去?出于某种原因,尽管我添加了“显示:块”元素并且我无法让子菜单实际出现在常见问题链接下方,但子菜单中的列表项并未显示在单独的行中=\
<nav id="navigation">
<ul>
<li><a href="/">Home</a>
</li>
<li><a href="/catalog.php">Catalog</a>
</li>
<li><a href="/build.php">Create A Sword</a>
</li>
<li><a href="/about.php">About Us</a>
</li>
<li><a href="/faq.php">F.A.Q.</a>
</li>
<ul id="submenu">
<li><a href="/measurement.php">Measuring</a>
</li>
<li><a href="/terminology.php">Terminology</a>
</li>
</ul>
<li><a href="/contact.php">Contact Us</a>
</ul>
</nav>
CSS
#navigation {
background: #000;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
position: relative;
height: 36px;
}
#navigation ul {
list-style-type: none;
margin-left: 10px;
padding: 0px;
}
#navigation ul li {
float: left;
display: block;
border-right: 1px solid #444;
}
#navigation ul li a {
display: block;
padding: 10px;
font-size: 13px;
text-decoration: none;
color: #ffffff;
text-transform: uppercase;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
}
#navigation ul li a:hover {
color: maroon;
}
#navigation ul li:first-child a {
padding-left: 0px;
}
#submenu {
position: absolute;
left: 90px;
list-style: none;
top: 30px;
background: #222222;
}
#navigation ul#submenu li a {
display: block;
padding: 5px 5px 13px 0px;
}
#navigation ul#submenu li {
display: block;
border: none;
}