项目符号点背景颜色属性?的CSS [英] Bullet point background color attribute? CSS
本文介绍了项目符号点背景颜色属性?的CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要更改项目符号点的背景颜色,
I'm looking to change the background colour of my bullet points,
ul {
list-style-type: square;
list-style-position: outside;
list-style-image: none;
}
是否有项目符号点背景颜色属性?这样的事吗?
Is there a bullet point background colour attribute? Somthing like this?
list-style-background-color: blue;
编辑
color: blue
更改字体颜色和项目符号点颜色,但是我只想更改项目符号点颜色,而不管字体.
Changes the font colour and the bullet point colour, but I would like to just change the bullet point colour and leave the font alone.
推荐答案
Demo
如果您不想使用< span>
或< div>
您可以使用:before
将自定义项目符号添加到您的 li
You can use :before
to add custom bullet to your li
li {
list-style:none;
}
li:before {
content: "";
position:relative;
left: -10px;
background-color:red;
display:inline-block;
width:5px;
height:5px;
}
这篇关于项目符号点背景颜色属性?的CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文