css 自定义checkbox多选复选框样式

html:
<input type="checkbox" id="" value="">菜单1
<input type="checkbox" id="" value="">菜单2
<input type="checkbox" id="" value="">菜单3
css:

input[type="checkbox"] {
text-indent:0;
margin: 0;
width: 17px;
height: 17px;
text-align:center;
display: inline-block;
vertical-align: middle;
line-height: 15px;
position: relative;
}
input[type="checkbox"]::before {
content: "";
position: absolute;
top: 0;
left: 0;
background: #fff;
width: 100%;
height: 100%;
border: 1px solid #bdbfc2;
}
input[type="checkbox"]:checked::before {
content: "\2713";
background-color: #37b048;
color: #fff;
position: absolute;
top: 0;
left: 0;
width: 100%;
font-size: 12px;
font-weight: bold;
outline: none;
border-color:#ccc;
border: 1px solid #bdbfc2;
}

 
 
posted @ 2018-11-19 14:57  Wow_Jerry  阅读(5379)  评论(0编辑  收藏  举报