需要引入awesome-bootstrap-checkBox.css、font-awesome.css以及font awesome对应的字体font文件,可在上面的网站上下载。
checkBoxs的样式
radio的样式
radio样式
Box label::before {
content: "";
display: inline-block;
position: absolute;
width: 20px;
height: 20px;
left: 0;
margin-left: -20px;
border: 1px solid #cccccc;
border-radius: 3px;
background-color: #fff;
-webkit-transition: border 0.15s ease-in-out,color 0.15s ease-in-out;
-o-transition: border 0.15s ease-in-out,color 0.15s ease-in-out;
transition: border 0.15s ease-in-out,color 0.15s ease-in-out;
}
.checkBox label::after {
display: inline-block;
position: absolute;
width: 16px;
height: 16px;
left: 0;
top: 0;
margin-left: -19px;
padding-left: 3px;
padding-top: 1px;
font-size: 13px;
color: #FAD500;
}
.checkBox input[type="checkBox"],.checkBox input[type="radio"] {
opacity: 0;
z-index: 1;
}
.checkBox input[type="checkBox"]:focus + label::before,.checkBox input[type="radio"]:focus + label::before {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
background-color: black;
border-color: black;
}
.checkBox input[type="checkBox"]:checked + label::before,.checkBox input[type="radio"]:checked + label::before {
background-color: black;
border-color: black;
}
.checkBox input[type="checkBox"]:checked + label::after,.checkBox input[type="radio"]:checked + label::after {
font-family: "FontAwesome";
content: "\f00c";
}
.checkBox input[type="checkBox"]:disabled + label,.checkBox input[type="radio"]:disabled + label {
opacity: 0.65;
}
.checkBox input[type="checkBox"]:disabled + label::before,.checkBox input[type="radio"]:disabled + label::before {
background-color: #eeeeee;
cursor: not-allowed;
}
.checkBox.checkBox-circle label::before {
border-radius: 50%;
以上所述是小编给大家介绍的Bootstrap复选框和单选按钮美化插件。编程之家 jb51.cc 收集整理的教程希望能对你有所帮助,如果觉得编程之家不错,可分享给好友!感谢支持。