CSS - 使用字符表示列表标记

Web*_*ner 5 html css html-lists

使用CSS,我如何设置像"►"这样的字符作为HTML列表的列表标记?

Mrc*_*ief 9

在CSS中使用所需字符的十六进制值,如下所示:

ul li:before { 
   content: "\25BA";  /* hex of your actual character, found using CharMap */
}
Run Code Online (Sandbox Code Playgroud)

注意:这在IE <8中不起作用

演示:http://jsfiddle.net/mrchief/5yKBq/

在子弹后添加空格:content: "\25BA" " ";
演示

你也可以使用这样的图像:

ul {
   list-style: disc url(bullet.gif) inside;
}
Run Code Online (Sandbox Code Playgroud)