我正在尝试创建一个均匀分布的导航菜单,无论菜单项是 1 行还是 2 行文本。我使用 1 行文本进行此操作,但如果某个项目超过一行,则文本的垂直间距会关闭。
到目前为止,我的代码如下。任何帮助都是极好的。提前致谢。
jsfiddle:http: //jsfiddle.net/wnfUC/
风格:
#pageNavigation {
background-image: url('../Images/TIBC_Base/nav-bg.png');
background-repeat: repeat-y;
margin:5px 0;
padding:5px 15px 5px;
min-height:125px;
}
#pageNavigation_bottom
{
clear:both;
background-image: url('../Images/TIBC_Base/nav-bg_bottom.png');
background-repeat: no-repeat;
margin:-5px 0 0 -1px;
min-height:8px;
}
#pageNavigation .navContent{ width:240px; margin:0 -10px; }
#pageNavigation ul { list-style-type: none; margin:0; padding:0; }
#pageNavigation ul li { display: block; height:57px; border-top:0px #E1E1E1 solid; border-bottom:1px #E1E1E1 solid; text-align:center; overflow:hidden; }
#pageNavigation a {
color:#485963;
font-size:16px;
text-decoration:none;
text-shadow: 0px -1px #EEEEEE;
display:block;
height:57px;
}
#pageNavigation a:hover
{
background: #FAE2AD;
color: #485963;
}
#pageNavigation a.NavigationSelected
{
color:#F9F9F9;
background: #A5B5BE;
text-shadow: 1px 1px #485963;
font-weight: normal;
}
HTML
<div id="pageNavigation">
<ul class="navContent">
<li><a href="/Services">Services</a></li>
<li><a href="/Services/Analysis">Analysis</a></li>
<li><a href="/Services/Strategic-Planning">Strategic Planning</a></li>
<li><a href="/Services/International-Market-and-Competitor-Research">International Market and Competitor Research</a></li>
<li><a href="/Services/Budgeting-and-Forecasting">Budgeting and Forecasting</a></li>
<li><a href="/Services/International-Cultural-Liaison" class="NavigationSelected">International Cultural Liaison</a></li>
</ul>
</div>