I am having trouble centering my links using list navigation. They are now left justified, an I would like them centered. I have a container that is 950px wide, can anyone tell me what is missing to center the links within the container div? text-align: center; does not seem to work for me.
Live Example Here
html
css
Any help would be greatly appreciated. Thanks!
Live Example Here
html
Code:
<div id="nav_container">
<ul id="menu">
<li><a href="">Home</a></li>
<li><a href="">About Us</a></li>
<li><a href="">Products</a> </li>
<li><a href="">Contact</a></li>
</ul>
</div>
css
#nav_container {
width: 950px;
position: relative;
}
#nav_container ul {
font-family: Arial, Verdana;
font-size: 14px;
margin: 0;
padding: 0;
list-style: none;
height: 34px;
}
#nav_container ul li {
display: block;
position: relative;
float: left;
}
#nav_container li ul {
display: none;
}
#nav_container ul li a {
display: block;
text-decoration: none;
color: #ffffff;
border-top: 1px solid #ffffff;
padding: 5px 15px 5px 15px;
background: #2C5463;
margin-left: 1px;
white-space: nowrap;
}
#nav_container ul li a:hover { background: #617F8A; }
Any help would be greatly appreciated. Thanks!
Last edited: