//默认
input[type="checkbox"] {
margin-top: 7px;
cursor: pointer;
position: relative;
width: 14px;
height: 14px;
font-size: 14px;
margin-right: 8px;
background-color:#fff;
}
//选中后修改
input[type="checkbox"]::after {
position: absolute;
top: 0;
//修改默认背景色
//修改默认对勾颜色
color: #fff;
width: 14px;
height: 14px;
display: inline-block;
visibility: visible;
text-align: center;
border-radius: 2px;
content: " ";
}
// 被选中
input[type="checkbox"]:checked::after {
border: none;
border-radius: 2px;
// content: "✔";
background-color:red;
content: "/";
font-size: 12px;
font-weight: lighter;
}
修改复选框样式
最新推荐文章于 2023-09-15 10:11:55 发布