awesome-bootstrap-checkbox 样式应用

引入bootstrap checkBox css 及字体依赖 font-awesome

    <link href="https://cdn.bootcss.com/awesome-bootstrap-checkbox/v0.2.3/awesome-bootstrap-checkbox.min.css" rel="stylesheet">
   <link href="__TMPL__Public/assets/vendor/font-awesome/css/font-awesome.css" rel="stylesheet">
   

自定义样式

 .checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] {
      position: relative;
   	  margin-left: 10px;
}
.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: #fff;
    border-color:#46b8da;
}

.checkbox input[type="checkbox"]:checked + label::before,
.checkbox input[type="radio"]:checked + label::before {
    background-color: #5bc0de;<!--选中后的背景颜色-->
    border-color: #46b8da;<!--选中后的边框颜色-->
}

.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 label::before {
    font-size: 25px;
    content: "";
    display: inline-block;
    position: absolute;
    width: 30px;  <!--大小-->
    height: 30px; <!--大小-->
    left: 0;
    margin-left: -30px; <!--距离-->
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
    -webkit-transition: border .15s ease-in-out,color .15s ease-in-out;
    -o-transition: border .15s ease-in-out,color .15s ease-in-out;
    transition: border .15s ease-in-out,color .15s ease-in-out;
}
  .checkbox label::after {
    display: inline-block;
    position: absolute;
    width: 30px;
    height: 30px;
    left: 0;
    top: 0;
    margin-left: -30px;
    padding-left: 6px;  <!--内部钩的距离-->
    padding-top: -5px;<!--内部钩的距离-->
    font-size: 20px;<!--内部钩的大小-->
    color: #ad6969;
}


Html 应用

<!--  在div 里设定 样式  checkbox  checkbox-primary -->  

 <div class="checkbox checkbox-primary">               
                <input type="checkbox" id="keywordsType" checked="checked"  class="styled" />
		         <label for="keywordsType" style=" font-size:18px;">
		                            随机
		       </label>
 </div>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值