我似乎无法让我的菜单正确居中。任何人都可以看到问题吗?
ul#navigation {
float: left;
margin: 0 auto;
padding: 0;
list-style-type: none;
min-width: 100px;
background: #003d4c;
padding-bottom: 15px;
text-align: center;
}
ul#navigation li {
border: 1px black solid;
min-width: 100px;
background-color: white;
list-style-type: none;
display: inline-block;
}
ul.sub_navigation {
position: absolute;
display: none;
}
ul.sub_navigation li {
clear: both;
}
a, a:active, a:visited {
display: block;
padding: 10px;
}
#header{
text-align: center;
padding: 10px 20px;
}
这是HTML:
<div id="container">
<div id="header">
<br />
<ul id="navigation">
<li class="dropdown"><a href="#"></a>
<ul class="sub_navigation">
<li><a href="#">Sub Navigation 1</a></li>
<li><a href="#">Sub Navigation 2</a></li>
<li><a href="#">Sub Navigation 3</a></li>
</ul>
</li>
...