加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 如何在无序列表中使用tick / checkmark符号(?)代替子弹

发布时间:2020-12-14 18:48:47 所属栏目:资源 来源:网络整理
导读:我有一个列表,我想在列表文本之前添加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 lithis is my text/li lithis
我有一个列表,我想在列表文本之前添加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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读