美文网首页
个性化复选框

个性化复选框

作者: 咏竹莉 | 来源:发表于2018-05-21 16:57 被阅读0次

效果图:

个性化复选框.png

html:

<input type="checkbox" name="" id="check_box" class="css-checkbox">
<label for="check_box" class="css-label">电梯能耗</label>

css:

input [type= checkbox].css-checkbox {
    position : absolute;
    z-index : -1000;
    left : -1000px ;
    overflow : hidden;
    clip : rect( 0 0 0 0);
    height : 1px ;
    width : 1px ;
    margin : -1px ;
    padding : 0;
    border : 0;
 }
input[type =checkbox]. css-checkbox + label .css-label {
    display : inline-block;
    height : 20px ;
    background-repeat : no-repeat;
    background-position : -839px 0;
    padding-left : 34px ;
    line-height : 20px ;
    cursor : pointer;
    margin-top : 15px ;
}
input[type =checkbox]. css-checkbox:checked + label. css-label {
    background-position : -786px 0;
}
label.css-label {
    background :url( "../images/eam_icon_all.png" ) no-repeat;
    -webkit-touch-callout : none;
    -webkit-user-select : none;
    -khtml-user-select : none;
    -moz-user-select : none;
    -ms-user-select : none;
    user-select : none;
    font-size : 16px ;
    color : #ccc;
    font-weight : normal;
}

相关文章

网友评论

      本文标题:个性化复选框

      本文链接:https://www.haomeiwen.com/subject/jxkqjftx.html