我意识到可以使用CSS属性将自定义图形指定为替换项目符号字符:
list-style-image
然后给它一个URL。
然而,在我的例子中,我只想使用'+‘符号。我不想为它创建一个图形,然后指向它。我宁愿只指示无序列表使用加号符号作为项目符号。
这是可以做到的吗?还是我必须先把它做成图形?
发布于 2013-12-31 16:19:31
.list-dash li, .list-bullet li {
position: relative;
list-style-type: none; /* disc circle(hollow) square none */
text-indent: -2em;
}
.list-dash li:before {
content: '— '; /* em dash */
}
.list-bullet li:before {
content: '• '; /*copy and paste a bullet from HTML in browser into CSS (not using ASCII codes) */
}
<ul class="list-dash">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
https://stackoverflow.com/questions/7698764
复制相似问题