如何修改CSS使得只有頂部項(索引項)都centerered,子項都很好(因爲它們已經位於左側)?圍繞只在CSS水平下拉菜單頂部指數菜單項
<div id="menu">
<ul>
<li><a href="#nogo">File</a>
<ul>
<li><a href="#nogo">Save</a></li>
<li><a href="#nogo">Link 1-2</a></li>
<li><a href="#nogo">Link 1-3</a></li>
</ul>
</li>
<li><a href="#nogo">Edit</a>
<ul>
<li><a href="#nogo">Link 2-1</a></li>
<li><a href="#nogo">Link 2-2</a></li>
<li><a href="#nogo">Link 2-3</a></li>
</ul>
</li>
<li><a href="#nogo">View</a>
<ul>
<li><a href="#nogo">Link 3-1</a></li>
<li><a href="#nogo">Link 3-2</a></li>
<li><a href="#nogo">Link 3-3</a></li>
</ul>
</li>
</ul>
</div>
/*HORIZONTAL DROP-DOWN MENU */
#menu{
padding:0;
margin:0;
position: fixed;
top: 33px;
left: 0px;
font-size: 8pt;
}
#menu ul{
padding:0;
margin:0;
}
#menu li{
position: relative;
float: left;
list-style: none;
margin: 0;
padding:0;
}
#menu li a{
width:120px;
height: 20px;
display: block;
text-decoration:none;
line-height: 20px;
background-color: #A9BBD3;
color: #FFF;
}
#menu li a:hover{
background-color: #446087;
}
#menu ul ul{
position: absolute;
top: 20px;
visibility: hidden;
}
#menu ul li:hover ul{
visibility:visible;
}
我們可以得到一個小提琴嗎? –