background: url("图片地址") no-repeat right center
float: left
margin-right: 14px
padding: 4px 15px 4px 0
}
你用firebug一看就知道啦,就是用一张2*36的图片,就是一条竖线的图作为盒子的背景,让它靠右中(水平右对齐,垂直居中)就OK啦
<div class="menu"><ul>
<li><a class="hide" href="index.html">首页</a></li>
<li><a class="hide" href="page.html">关于我们</a>
<ul>
<li><a href="page.html">关于合作建房</a></li>
<li><a href="page.html">企业文化</a></li>
<li><a href="page.html">企业荣誉</a></li>
<li><a href="page.html">核心理念</a></li>
</ul>
</li>
<li><a class="hide" href="#">合作成功密码</a>
<ul>
<li><a href="page.html">合作模式</a></li>
<li><a href="page.html">加入流程</a></li>
<li><a href="#">团购幸福家</a></li>
<!--链接页面待定,先链接到page03.html-->
</ul>
</li>
<li><a class="hide" href="#">案例参考</a>
<ul>
<li><a href="page.html">成功案例</a></li>
<li><a href="page.html">失败案例</a></li>
<li><a href="page.html">国外案例</a></li>
</ul>
</li>
<li><a class="hide" href="#">区域项目简介</a>
<ul>
<li><a href="page02.html">华南(国际)口腔医疗器械城</a></li>
<li><a href="page02.html">华南(国际)医疗器材产业中心</a></li>
<li><a href="page02.html">清远红场大型购物商场</a></li>
<li><a href="page02.html">佛山鸿业幼儿园</a></li>
<li><a href="page02.html">佛山西樵金果广场</a></li>
<li><a href="page02.html">佛山石湾行政服务中心</a></li>
</ul>
</li>
<li><a class="hide" href="reg.html">我要报名</a> </li>
<li><a class="hide" href="news-list.html">法律保障</a> </li>
<li><a class="hide" href="page.html">联系我们</a> </li>
</ul>
<div class="clear"> </div>
</div> .menu {
font-family: arial, sans-serif
width: 1000px
height: 38px
margin-top: 5px
position:relative
z-index:10
}
.menu ul {
padding: 0
margin: 0
list-style-type: none
position:relative
z-index:10
}
.menu ul li {
width: 125px
height: 38px
float: left
position: relative
background: url(../images/index_09.jpg) no-repeat left
position:relative
z-index:10
}
.menu ul li a {
display: block
text-align: center
text-decoration: none
display: block
height: 38px
color: #bfd9eb
line-height: 33px
font-size: 14px
font-weight: bold
position:relative
z-index:10
}
.menu ul li a:visited {
display: block
text-align: center
text-decoration: none
width: 125px
display: block
height: 38px
line-height: 38px
font-size: 14px
font-weight: bold
position:relative
z-index:10
}
.menu ul li ul {
display: none
position:relative
z-index:10
}
.menu ul li:hover a {
color: #000
background: #fff
border: none
position:relative
z-index:10
}
.menu ul li:hover ul {
display: block
position: absolute
top: 35px
left: 0
border-top: none
}
.menu ul li:hover ul li a {
display: block
background: #fff
color: #000
font-size: 12px
font-weight: normal
text-align: left
padding-left: 10px
border: none
}
.menu ul li:hover ul li a:hover {
background: #008fc3
color: #f00
}