Forum Moderators: not2easy
FYI, the doctype is: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
CSS
/* navigation */
#navcontainer {
left:50%;
margin:0 0 0 -59px;
position:absolute;
width:104px;
}
#navcontainer ul
{
margin-left: 0;
padding-left: 0;
list-style-type: none;
font-family: Arial, Helvetica, sans-serif;
text-align:center;
}
#navcontainer a
{
display: block;
padding: 8px;
width: 105px;
background-color: #400000;
}
#navcontainer a:link, #navlist a:visited
{
color: #D8C6A6;
text-decoration: none;
}
#navcontainer a:hover
{
background-color: #D8C6A6;
color: #400000;
}
HTML
<div id="navcontainer">
<ul id="navlist">
<li><a href="http://www.example.com">Home</a></li>
<li><a href="http://www.example.com/contactus.html">
ContactUs</a></li>
<li><a href="http://www.example.com/aboutus.html">Who Are We?</a></li>
<li><a href="http://www.example.com/services.html">Services / Prices</a></li>
<li><a href="http://www.example.com/portfolio.html">
Portfolio</a></li>
</ul>
</div>
Thank you!
[edited by: jatar_k at 3:18 pm (utc) on Nov. 9, 2007]
[edit reason] please use example.com [/edit]
Why is the width of the #navcontainer set at 104px? Place a 1px red border on that element, you will see it doesn't cover the width of the menu. Your #navcontainer a is 105px plus 8px each side (total 121px), so try setting #navcontainer as 121px with a negative margin of 61px. (Without seeing more code, it's not easy to diagnose.)
it's quite possible there are overlapping divs as Marshall suggested but on the z-axis rather than visually
also just fyi if you also float the
#navcontainer a elements you can remove the whitespace between the links in IE7 (at least I'm seeing whitespace in this test code sample :o)