I just spent all day trying to center this navigation menu. I’m able to center it by setting “display: inline;” but this keeps me from being able to specify the height or set a background image.
Here is the CSS. The markup is at the end.
#nav {
overflow: hidden;
min-width: 65em; /* PREVENT OVERLAP 1040 px / 16 px = 65em
margin: 0;
padding: 0;
list-style: none;
font-family: “DAX-Medium”, Verdana, Arial Black, Gadget, sans-serif;
font-size: .8em; /* 12.8px / 16px = .8em
background: #B5B5B5 url(/Epic/Menu/Menu_Off66px.jpg) repeat-x top left;
}
#nav li {
float: left;
margin: 0;
padding: 0;
}
#nav a {
display: block;
padding: 3em 1em 0 1em;
text-decoration: none;
color: #000000;
background: #B5B5B5 url(/Epic/Menu/Menu_Off66px.jpg) repeat-x top left;
}
#nav a:hover, body#intro #t-intro a {
background: #B4CCCC url(/Epic/Menu/Menu_On66px.jpg) repeat-x top left;
}
HTML
<body id=”intro”>
<ul id=”nav”>
<li id=”t-intro”><a href=”/”>HOME</a></li>
<li id=”t-about”><a href=”#”>OPTION 1</a></li>
<li id=”t-news”><a href=”#”>OPTION 2</a></li>
<li id=”t-sponsors”><a href=”#”>OPTION 3</a></li>
<li id=”featured”><a href=”#”>OPTION 4</a></li>
<li id=”market”><a href=”#”>OPTION 5</a></li>
<li id=”blog”><a href=”#”>OPTION 6</a></li>
<li id=”about”><a href=”#”>OPTION 7</a></li>
</ul>
</body>