<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>更改默认的单选和多选框样式</title>
<style>
/*单选框*/
input[type="radio"]{
width: 16px;
height: 16px;
margin:0 5px 0 20px;
vertical-align: middle;
cursor: pointer;
position: relative;
top: 0px;
left: 0px;
}
input[type="radio"]:after{
display: block;
content: " ";
color: #fff;
width: 16px;
height: 16px;
border-radius: 8px;
background: yellowgreen;
position: absolute;
top: 0px;
left: 0px;
}
input[type="radio"]:checked:after{
content: "✓";
text-align: center;
}
/*多选框*/
input[type="checkbox"]{
width: 16px;
height: 16px;
margin:0 5px 0 20px;
vertical-align: middle;
cursor: pointer;
position: relative;
top: 0;
left: 0;
}
input[type="checkbox"]:after{
display: block;
更改单选多选默认样式
最新推荐文章于 2021-01-20 21:11:59 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)