css提供了列表标签li,通过list-style-type属性可以设置列表项标记的类型。例如:disc、circle、square、decimal等。
那如何自定义标记的类型呢?
li::before{
content:"★";
color:blue;
font-size:30px;
}
通过如上代码可以显示

这样只需要通过改变content内容即可替换其他各种标记形状了,color可以控制标记的颜色,font-size可以控制标记的大小。
当然也可以通过添加图片来增加更复杂的标记的形状:
li::before{
content:url(edit.png);
font-size:30px;
}

网友评论