修改 ul li 前面小圆点的颜色

html li 前面的点或者方块 颜色怎样控制

方法一:

先重置掉ul li 默认的点,然后采用这样的写法

<ul>
 <li><span class="dot"></span>内容内容内容</li>
</ul>

其中,.dot{display: inline-block;width: 3px;height: 3px;margin-right: 5px;background: #666;vertical-align: middle;overflow: hidden;}

为了兼容不同浏览器,可能需要设置.dot的hack。

方法二:

用图片来做

li{list-style:none}把默认的给去掉,然后把着了色的圆点切成一张背景图片使用;

li{background:url(图点图片路径) no-repeat;}

方法三:

纯css实现

ul {
list-style: none;
counter-reset: count;
}

li:before {
content: "● ";
color: red;
}

如何修改html中列表项li所显示的圆点的颜色?

ul {
list-style: none;
counter-reset: count;
}

li:before {
counter-increment: count;
content: ""counter(count)"、";
color: red;
}

如何修改html中列表项li所显示的圆点的颜色2

参考:

http://www.ablanxue.com/shtml/201507/27423_1.shtml

http://www.zhihu.com/question/30666575