0
点赞
收藏
分享

微信扫一扫

css 将无序列表前面的小点变成图片 并调整图片大小

捡历史的小木板 2022-01-23 阅读 61

我们先建一个普通的无序列表

<ul>
  <li>111</li>
  <li>222</li>
  <li>333</li>
</ul>

关键还是在于css

ul li {
     list-style-type: none;
     line-height: 1.2em;
     background: url("图片的路径") no-repeat 0rem 0.3rem;
     background-size: 1.2em 1.2em;
     text-indent: 2em;
 }

可以实现效果 但其实不好用 个人建议 还是直接用div去做会好控制很对

举报

相关推荐

0 条评论