I don't see that gap and I believe that's because we use different default font. This brings up a point that, use em as the unit here is not the best - 1em means the same size as the text, and 2em means 2 times bigger etc. - it creates dependency on the font.
Let's specify the height of the div use px, and set the padding to the same. Try the following (I used 200px only to make this visual, you need to adjust):
Code:
#main_nav {
border:1px solid black;
padding:2em 25px;
margin:0 auto 2em auto;
width:60%;
max-width:800px;
height: 200px
}
#main_nav ul {
margin:0;
padding:0;
}
#main_nav ul li {
display:inline;
list-style-type:none;
margin:0 0 0 -4px;
padding:0;
}
#main_nav ul li a {
padding:200px 2em;
color:#333333;
text-decoration:none;
border-right:1px solid black;
}
#main_nav ul li a:hover {
background:#0387DC
}