我想在懸停但不工作時播放菜單。如何正確顯示下拉菜單
HTML代碼倒afficher:
<nav>
<ul class="menu">
<li><a href="index.html">home</a></li>
<li class="current">other</a></li>
<li>
<a href="index-2.html">services</a>
<ul class="drop">
<li><a href="index-2.html">s1</a></li>
<li><a href="index-4.html">s2</a></li>
</ul>
</li>
</ul>
</nav>
CSS代碼來顯示菜單和下拉:
nav .menu li:hover > a {
background: #e2782e;
transition: all 0.5s;
color: white;
font-weight:bold;
}
.drop{
display:none;
}
li :hover > .drop{
display:black;
}
顯示:黑色 - >顯示:塊 –