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;
}

 
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM