css li的图标问题

html-css017

css li的图标问题,第1张

<html><title>列表样式图片 list-style-image</title><head><style type="text/css">ul li{ list-style-type:none} ul li{ background:url( 地址换成你的!其他的不要动) no-repeat 4px 5pxline-height:30pxfont-family:"宋体"font-size:12px} </style></head><body><ul><li>卖品网</li><li>购物平台</li><li>购物评论</li><li>商品优惠信息</li></ul></body></html>ul li{list-style-type:none}让li前面没有那个点的! background:url(图片地址) no-repeat(不平铺)4px(上下距离)5px(左右距离)

给你段代码,如果你会CSS的话就应该能自己用了!

<style>

ul{list-style-type:none}

li{background:url(你的图标路径) no-repeat center left<br/> padding-left:具体数值//这是根据你背景图片的宽度而定的,也就是你图片有多宽,文本就离左边多这样就不会覆盖背景图片,达到实现你想要的那种效果!<br/>}

</style>

这个叫列表项标志,有三种标识方法:

1、list-style-type 值对应的描述:

none    无标记。    

disc    默认。标记是实心圆。    

circle    标记是空心圆。    

square    标记是实心方块。    

decimal    标记是数字。    

decimal-leading-zero    0开头的数字标记。(01, 02, 03, 等。)    

lower-roman    小写罗马数字(i, ii, iii, iv, v, 等。)    

upper-roman    大写罗马数字(I, II, III, IV, V, 等。)    

lower-alpha    小写英文字母The marker is lower-alpha (a, b, c, d, e, 等。)    

upper-alpha    大写英文字母The marker is upper-alpha (A, B, C, D, E, 等。)    

lower-greek    小写希腊字母(alpha, beta, gamma, 等。)    

lower-latin    小写拉丁字母(a, b, c, d, e, 等。)    

upper-latin    大写拉丁字母(A, B, C, D, E, 等。)    

hebrew    传统的希伯来编号方式    

armenian    传统的亚美尼亚编号方式    

georgian    传统的乔治亚编号方式(an, ban, gan, 等。)    

cjk-ideographic    简单的表意数字    

hiragana    标记是:a, i, u, e, o, ka, ki, 等。(日文片假名)    

katakana    标记是:A, I, U, E, O, KA, KI, 等。(日文片假名)    

hiragana-iroha    标记是:i, ro, ha, ni, ho, he, to, 等。(日文片假名)    

katakana-iroha    标记是:I, RO, HA, NI, HO, HE, TO, 等。(日文片假名)

2、list-style-image语法格式:

 li {list-style-image : url(xxx.gif)}

3、list-style 简写列表样式:

//语法规则:

li {list-style : url(example.gif) square inside}

//值-》参数

list-style-type    设置列表项标记的类型。    

list-style-position    设置在何处放置列表项标记。

list-style-image    使用图像来替换列表项的标记。

inherit    规定应该从父元素继承 list-style 属性的值。