我試圖實現用戶懸停在F.A.Q上的子菜單效果。鏈接和一個子菜單下降,並顯示另外兩個選項 - 但我似乎甚至沒有得到正確的HTML(沒關係jQuery),任何人都可以幫助我?出於某種原因,子菜單中的列表項不會單獨顯示,儘管我添加了「display:block」元素,而且我無法讓子菜單真正出現在F.A.Q的下面。鏈接= \如何實現子菜單效果?
<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;
}
:http://jsfiddle.net/techsin/FtPvf/1/embedded/result/我正想回答,但samething一直回答已經三次了。 –