我正在尝试制作一个外观精美的菜单,该菜单可以扩展并显示其中的选项,但是我在正确设置 CSS 时遇到了问题。我想让子菜单从城市名称中弹出。但我无法让城市名称适合那里。
CSS
ul { margin : 80px 0 0 0; padding: 0; white-space : nowrap;}
li a { padding-left: 10px; }
li {
display : block;
padding : 2px 10px 2px 40px;
margin : 0 0 15px 0;
background : #929292;
width : 0;
overflow : hidden;
cursor : pointer;
-webkit-transform: rotate(0deg) translateX(0px);
-webkit-transition: all 0.33s linear 0s;
-moz-transform: rotate(0deg) translateX(0px);
-moz-transition: all 0.33s linear 0s;
}
li:hover {
background : #fff; width: 180px;
-webkit-transform: rotate(0deg) translateX(0px) translateY(0px);
-moz-transform: rotate(0deg) translateX(0px) translateY(0px);
}
HTML
<ul>
<li>Florence<a href="flo.php">Florence</a></li>
<li>Tuscumbia<a href="tusc.php">Tuscumbia</a></li>
<li>Muscle Shoals<a href="ms.php">Muscle Shoals</a></li>
<li>Sheffield<a href="shef.php">Sheffield</a></li>
</ul>