对列表 ul,li的综合应用
来源:岁月联盟
时间:2008-09-08
为了添加定制列表符号,可以在list-style-image属性。但是这种方法对符号图像的控制能力不强。
更常用的方法是 关闭列表符号 并将定制符号作为背景在列表元素上。然后可以使用背景定位精确控制对准方式
ul{margin:0;padding:0;list-style-type:none;}
li{background:url(1.gif) no-repeat 50%;padding-left:30px; }
2.创建垂直导航
<ul>
<li><a href="a.html">home</a></li>
<li><a href="b.html">home1</a></li>
<li><a href="c.html">home1</a></li>
</ul>
第一,首先去掉符号,空白边,填充为0
ul{margin:0;padding:0;list-style-tyle:none;}
ul a{display:block;
width:200px;
line-height:39x;
color:#000;
text-decoration:none;
background:#94b8e9 url(images/pix.gif) no-repeat left bottom; text-indent:50px;}
上一篇:无序列表ul li的常用css
下一篇:ul与li的区别