侧边栏壁纸
博主头像
黑山老妖 博主等级

记录精彩的坎坷人生

  • 累计撰写 82 篇文章
  • 累计创建 94 个标签
  • 累计收到 9 条评论

目 录CONTENT

文章目录

css如何给li标签前添加数字

我是我村的希望
2023-03-01 / 0 评论 / 1 点赞 / 14 阅读 / 0 字 / 正在检测是否收录...
温馨提示:
本文最后更新于244天前,若内容或图片失效,请留言反馈。 部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

本站图片存储及加速服务由壹加图床提供

使 li 标签前添加逐渐增加的数字,1、2、3、4、5 这样子分享给大家

.head_new ul{counter-reset:sectioncounter;}
.head_new ul li:before {
    display: inline-block;
    content: counter(sectioncounter);
    counter-increment: sectioncounter;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    border-radius: 50%;
    margin-right: 1em;
    background: #5bc648;
    color: #efe;
    font-size: 14px;
}
1

评论区