我正在为此处显示的网站更新标题导航菜单:
如您所见,文本和分隔符被向下推,菜单看起来关闭。我尝试了几种不同的方法无济于事。我希望文本和分隔符彼此垂直对齐,而顶部没有额外的填充。
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>
非常感谢您的帮助。