圆圈加数字的css

方式一

复制代码
.circle {
width: 50px;
height: 50px;
border-radius: 50%;
background-color: #f00;
color: #fff;
text-align: center;
line-height: 50px;
}
.circle::before {
content: attr(data-number);
display: block;
}
<div class="circle" data-number="1"></div>
<div class="circle" data-number="2"></div>
<div class="circle" data-number="3"></div>

方式二

复制代码
.circle {
width: 50px;
height: 50px;
border-radius: 50%;
background-color: #f00;
color: #fff;
text-align: center;
line-height: 50px;
}
.circle::before {
content: "1";
display: block;
}

下面是使用案例

复制代码
<div class="green_list flex_align" v-for="(item,index) in StepReviewLogs.logs"
                                :key="item.id">
                                <div class="flex_align">
                                  <div class="circle" :data-number="index+1"></div> {{item.remark}}: {{item.userName}}
                                </div>
                              </div>

 .circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    /* background-color: #67C23A; */
    border: 1px solid #67C23A;
    color: #67C23A;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0px 3px;
    font-size: 12px;
  }

  .circle::before {
    content: attr(data-number);
    display: block;
    margin-left: 1px;
  }
  .green_list {
    color: rgba(103, 194, 58, 1);

  }
  .flex_align {
    display: flex;

    align-items: center;

  }
相关推荐
岁月宁静8 分钟前
从0到1:智能汇 AI 全栈实战,拆解多模态 AI 应用开发全流程
前端·vue.js·node.js
廾匸6409 分钟前
语义化标签
前端·javascript·html
汪汪队立大功12315 分钟前
selenium中执行javascript,是否等价于在浏览器console位置执行
javascript·selenium·测试工具
烛阴31 分钟前
隐式vs显式:解密C#类型转换的底层逻辑
前端·c#
Fantasydg32 分钟前
AJAX JSON学习
前端·学习·ajax
瓢儿菜20181 小时前
Web开发:什么是 HTTP 状态码?
前端·网络协议·http
1024小神1 小时前
swiftui使用WKWebView加载自签的https服务,允许不安全访问
前端
anyup1 小时前
支持鸿蒙!开源三个月,uView Pro 开源库近期更新全面大盘点,及未来计划
前端·vue.js·uni-app
BBB努力学习程序设计2 小时前
用Bootstrap一天搞定响应式网站:前端小白的救命稻草
前端·html
嘴平伊之豬2 小时前
跟着AI速度cli源码三-交互问答系统
前端·node.js