我有以下CSS:
#cssmenu .has-sub .has-sub:hover > ul {
height: 76px;
}
#cssmenu .has-sub .has-sub ul {
height: 0px;
overflow: hidden;
position: inherit;
left: -1px;
top: -1px;
background-color: #999;
transition: height 2s;
-moz-transition: height 2s; /* Firefox 4 */
-webkit-transition: height 2s; /* Safari and Chrome */
-o-transition: height 2s; /* Opera */
}
使用这个 html:
<div id="cssmenu">
<ul>
<li class="active has-sub"><a href="#"><span>Products</span></a>
<ul>
<li class="has-sub"><a href="#"><span>Product 1</span></a>
<ul>
<li><a href="#"><span>Sub Product</span></a></li>
<li class="last"><a href="#"><span>Sub Product</span></a></li>
</ul>
</li>
<li class="has-sub"><a href="#"><span>Product 2</span></a>
<ul>
<li><a href="#"><span>Sub Product</span></a></li>
<li class="last"><a href="#"><span>Sub Product</span></a></li>
</ul>
</li>
<li class="has-sub"><a href="#"><span>Product 3</span></a>
<ul>
<li><a href="#"><span>Sub Product</span></a></li>
<li class="last"><a href="#"><span>Sub Product</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
当我将鼠标移到产品 1 上时,我会:
过渡只是不起作用。我哪里出错了?