我正在使用無序列表創建導航欄。我希望我的列表元素(element1,element2)寫在外部創建的框的中心。中心navbar列表元素?
----------- -------------
el1 whereas presently it is coming to the right like el1
----------- ------------
HTML:
<div id="central-section" class="central-section-base">
<div id="ddtopmenubar" class="mattblackmenu">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#" rel="ddsubmenu1">Element 1</a></li>
<li><a href="#" rel="ddsubmenu2">Element 2</a></li>
<li><a href="#" rel="ddsubmenu3">Element 3</a></li>
</ul>
</div>
CSS:
.mattblackmenu ul{
margin: 0;
padding: 0;
font: bold 12px Verdana;
list-style-type: none;
border-bottom: 1px solid gray;
background: #153E7E;
overflow: hidden;
width: 100%;
text-align: center;
}
.mattblackmenu li{
display: table;
margin:0px auto 0px auto;
text-align:center;
}
.mattblackmenu li a{
float: left;
display: block;
text-decoration: none;
margin: 0;
padding: 6px 8px; /*padding inside each tab*/
border-right: 1px solid white; /*right divider between tabs*/
color: white;
background: #153E7E;
}
我也使用水平導航插件(http://sebnitu.github.io/HorizontalNav/)。
需要更多解釋。放一個截圖/小提琴 – super