Reputation: 425
I'm in the process of updating a header navigation menu for a website shown here:
As you can see, the text & separators are pushed down and the menu looks off. I've tried a couple of different things to no avail. I'd like to have the text & separators vertically aligned with each other without that extra padding at the top.
CSS
/*Header Link Wrap & Align*/
#nav-wrap {
width: 100%;
overflow: hidden;
height: 52px;
background-image: url(/nd/images/hlink-bg.jpg);
background-repeat: repeat-x;
}
#nav {
text-align: center;
}
#nav li {
list-style: none;
display: inline-block;
vertical-align: middle;
padding: 0px 10px 0px 0px;
}
#nav a {
color: #FFFFFF;
display: inline-block;
font-family:arial;
margin: 0;
padding: 9px 18px 9px 18px;
text-decoration: none;
vertical-align: middle;
}
#nav a:hover {
background-color: #ffa500;
color: #fff9;
}
.head-divider {
list-style: none;
vertical-align: middle;
display: inline-block;
margin: 0;
width:2px;
height:52px;
background-image:url(/nd/images/h-divider.jpg);
background-repeat: no-repeat;
}
HTML
<div id="nav-wrap">
<ul id="nav">
<li><a href="homes.php">Custom Homes</a></li>
<li class="head-divider"></li>
<li><a href="inspections.php">Inspection Services</a></li>
<li class="head-divider"></li>
<li><a href="energy.php">Energy Audits</a></li>
<li class="head-divider"></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>
</div>
Your help is much appreciated.
Upvotes: 0
Views: 262
Reputation: 8544
You can reset the margin
and padding
of the <ul>
simply.
Add the following style to you #nav
:
#nav{
margin:0px;
padding:0px;
}
Upvotes: 2