1px shift when using unordered list
Posted: 13 December 2008 12:46 AM   [ Ignore ]
Newbie
Rank
Total Posts:  9
Joined  2008-05-23

Hey everyone, I’ve been having a problem with my layout that’s starting to annoy me so I thought I’d ask for help. I have a horizontal nav menu that’s wrapped in a set of <ul> tags. Everything with the nav menu is fine except that I’ve noticed that my nav menu seems to shift up or down 1px when switching between my homepage and any other page. This wouldn’t be a big problem except that the shift occurs differently between ie and ff. The problem seems to go away if I get rid of the <ul> tags while keeping each nav item wrapped in <li> tags, but obviously I cannot do this b/c it is improper code. I’ve posted my html and css for my menu below. Any suggestions?

HTML:

<div id="header">

    <
div id="logo"></div>

    <
div id="menu">

      <
ul>
        <
li><a href="index.html">HOME</a></li>
        <
li><a href="aboutus.html">ABOUT US</a></li>
        <
li><a href="grants.html">GRANTS</a></li>
        <
li><a href="collaboration.html">COLLABORATION</a></li>
        <
li><a href="staff.html">STAFF</a></li>
        <
li><a href="events.html">EVENTS</a></li>
        <
li><a href="people.html">PEOPLE</a></li>
        <
li><a href="http://blogs.cornell.edu/nyswri/">BLOG</a></li>
        <
li><a href="wrifeed.xml"><img src="images/rss_icon.png" />SUBSCRIBE</a></li>
      </
ul>

    </
div>

</
div

CSS:

#header {
positionabsolute;
background-imageurl(images/headerbar.png);
top0px;
left0px;
width100%;
height35px;
min-width950px;
}
#logo {
positionrelative;
top2px;
left: -458px;
background-imageurl(images/logo2.jpg);
width36px;
height33px;
margin-rightauto;
margin-leftauto;
}
#menu {
positionrelative;
margin-rightauto;
margin-leftauto;
width870px;
top: -25px;
}
#menu ul {
list-stylenone;
margin0;
padding0;
bordernone;
}
#menu li {
text-decorationnone;
displayinline;
margin-left30px;
}
#menu a:Link, a:Active, a:Visited {
positionrelative;
top: -1px;
font-familyHelvetica"Myriad Pro""Trebuchet MS"sans-serif;
font-size10px;
text-decorationnone;
color#CCCCCC;
letter-spacing2px;
}
#menu a:Hover {
color#5D95C1;
}
#menu a:Focus {
outlinenone;
}
#menu a img {
vertical-alignmiddle;
Profile