实现效果:
代码:
<html><head>
<title></title>
<style type="text/css">
/**绿色勾*/
.myicon-tick-checked {
display: inline-block;
position: relative;
width: 15px;
height: 15px;
border-radius: 50%;
background-color: #2ac845;
}
/**灰色勾*/
.myicon-tick-uncheck {
display: inline-block;
position: relative;
width: 15px;
height: 15px;
border-radius: 50%;
background-color: #5f646e;
}
.myicon-tick-checked:before, .myicon-tick-checked:after,.myicon-tick-uncheck:before,.myicon-tick-uncheck:after {
content: '';
pointer-events: none;
position: absolute;
color: white;
border: 1px solid;
background-color: white;
}
.myicon-tick-checked:before,.myicon-tick-uncheck:before {
width: 1px;
height: 1px;
left: 25%;
top: 50%;
transform: skew(0deg,50deg);
}
.myicon-tick-checked:after,.myicon-tick-uncheck:after {
width: 3px;
height: 1px;
left: 45%;
top: 42%;
transform: skew(0deg,-50deg);
}
</style>
</head>
<body>
<span class="myicon-tick-checked"></span>
<span class="myicon-tick-uncheck"></span>
</body>
</html>
本文介绍如何使用纯CSS实现绿色和灰色的勾选图标,并通过简单的样式调整来切换两种状态。该方法适用于网页中需要直观展示勾选状态的场景。
小图标&spm=1001.2101.3001.5002&articleId=79463274&d=1&t=3&u=5dba09a9faf44d8d8412b8726abd9cd8)
1054

被折叠的 条评论
为什么被折叠?



