站内搜索:
首页 >> 前端 >> 内容
纯CSS的CheckBox“编程开发”

时间:2017/10/30 15:51:15

废话不多说 贴代码

.limits {
    padding: 20px 50px 0px;
}
.limits section{
    padding: 0px 50px;
}

.limits input[type=checkbox] {
    visibility: hidden;
}

    .limits .checkbox {
        width: 15px;
        height: 15px;
        background-color: #5A8BFF !important;
        position: relative !important;
        border: 1px solid #5A8BFF !important;
        display: inline-block;
        margin: 0 !important;
        top: 2px;
    }


    .limits .checkbox label {
        position: absolute !important;
        width: 15px !important;
        height: 15px !important;
        background: #fff !important;
        left: 0 !important;
        cursor: pointer !important;
        transition: all .5s ease-in !important;
        padding:0!important;
    }

.limits input[type=checkbox]:checked + label {
    background-color: #5A8BFF !important;
}

    .limits input[type=checkbox]:checked + label:after {
        content: '\00a0' !important;
        display: inline-block !important;
        border: 2px solid #fff !important;
        border-top-width: 0 !important;
        border-right-width: 0 !important;
        width: 9px !important;
        height: 5px !important;
        -webkit-transform: rotate(-50deg) !important;
        position: absolute !important;
        top: 3px !important;
        left: 3px !important;
        z-index: 1 !important;
    }

.limits input[type=checkbox] + label:after {
    content: '\00a0' !important;
    display: inline-block !important;
    border: 2px solid #5A8BFF !important;
    border-top-width: 0 !important;
    border-right-width: 0 !important;
    width: 9px !important;
    height: 5px !important;
    -webkit-transform: rotate(-50deg) !important;
    position: absolute !important;
    top: 3px !important;
    left: 3px !important;
    z-index: 1 !important;
}


纯CSS的CheckBox“编程开发”


注释掉这一段

.limits input[type=checkbox] + label:after {
    content: '\00a0' !important;
    display: inline-block !important;
    border: 2px solid #5A8BFF !important;
    border-top-width: 0 !important;
    border-right-width: 0 !important;
    width: 9px !important;
    height: 5px !important;
    -webkit-transform: rotate(-50deg) !important;
    position: absolute !important;
    top: 3px !important;
    left: 3px !important;
    z-index: 1 !important;
}

就是纯CSS的CheckBox“编程开发”

  • 上一篇:HTTP协议介绍
  • 下一篇:Synchronized的实现原理、常用的三大线程池讲解
  • 返回顶部