我想为li标签使用字符而不是图片。我在Google上找不到任何帮助
我知道list-style-image: url(myimage.gif)
,但我不想使用图片,因为它不具有可扩展性,并且在视网膜上看起来不太好。
答案 0 :(得分:10)
你的意思是“我可以使用一些文字而不是一个子弹点或图像吗?”
如果是这样,css :before
pseudo-element可以提供帮助:
li {
list-style-type: none;
}
li:before {
content: '* ';
}
显然用您选择的文字替换“*”。
您可以使用:before
元素上的普通CSS来设置样式。例如:
li:before {
content: '> ';
font-family: 'wingdings';
font-weight: bold;
}
通过将此技术与Font Awesome等SVG字体相结合,您可以获得可扩展的图形。