您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Unicode字符作为CSS中列表项的项目符号

Unicode字符作为CSS中列表项的项目符号

我可能不再建议使用图像。我会坚持使用Unicode字符的方法,如下所示:

li:before {
  content: "\2605";
}

我可能会选择图像背景,它们更 有效, 通用且对跨浏览器友好。

这是一个例子:

<style type="text/css">
  ul {list-style:none;} /* you should use a css reset too... ;) */
  ul li {background:url(images/icon_star.gif) no-repeat 0 5px;}
</style>

<ul>
  <li>List Item 1</li>
  <li>List Item 2</li>
  <li>List Item 3</li>
</ul>
CSS 2022/1/1 18:16:45 有435人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶