我有一个列表,我想在列表文本之前添加tick符号.有没有可以帮助我应用这种方式的CSS?
✓ this is my text ✓ this is my text ✓ this is my text ✓ this is my text ✓ this is my text ✓ this is my text
注意:我想要这种HTML代码
<ul> <li>this is my text</li> <li>this is my text</li> <li>this is my text</li> <li>this is my text</li> <li>this is my text</li> </ul>
解决方法
您可以使用
pseudo-element在每个列表项之前插入该字符:
ul { list-style: none; } ul li:before { content: '✓'; }
<ul> <li>this is my text</li> <li>this is my text</li> <li>this is my text</li> <li>this is my text</li> <li>this is my text</li> </ul>