css - 使用纯 css3 在一个圆圈(图标)内打勾/打勾
问题描述
我正在尝试使用纯 css3 在其中绘制一个带有刻度/复选标记的圆圈
.success-checkmark {
content: '✔';
position: absolute;
left:0; top: 2px;
width: 17px; height: 17px;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 50%;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
我怎样才能实现我已经尝试过上面的代码?
解决方案
您content: '✔';
只能在伪元素上使用,因此请尝试使用以下选择器:
.success-checkmark:after {
content: '✔';
position: absolute;
left:0; top: 2px;
width: 20px;
height: 20px;
text-align: center;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 50%;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
<div class="success-checkmark"></div>
推荐阅读
- ios - 当用户输入的时间低于预期时间时,如何在 swiftUI 中显示警报消息?
- python - 如何在不使用循环的情况下将数组递归转换为链表?对于蟒蛇
- python - 如果满足条件,如何将数据框行拆分为多个数据框行?
- node.js - 在节点js中将excel文件转换为json时出错
- azure - Azure Kubernetes 服务:如何在不更改节点池架构的情况下降低虚拟机成本?
- browser - ThreeJS 渲染 3D 模型而不在浏览器中暴露原始文件
- chatbot - Google Dialogflow-CX 中的条件响应
- python-3.x - 从 Python 中的不同列连接 Pandas DataFrame 中的列表元素
- javascript - 如果与同一行中的单元格相同,则谷歌应用脚本清除单元格
- jmeter - 在 Jmeter http 请求中循环一个静态值