• 自定义 css checkbox 样式


    .checkbox{
            -webkit-appearance: none;
            appearance: none;
             18px;
            height: 18px;
            margin: 0;
            cursor: pointer;
            vertical-align: bottom;
            background: #fff;
            border: 1px solid #DADADA;
            -webkit-border-radius: 1px;
            -moz-border-radius: 1px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            position: relative;
            overflow:hidden;
    }
    
    .checkbox:active {
            border-color: #DADADA;
            background: #ebebeb;
    }       
            
    .checkbox:hover {
            border-color: #0E76A8;
            -webkit-box-shadow: inset 0 2px 2px rgba(0,0,0,0.1);
            -moz-box-shadow: inset 0 2px 2px rgba(0,0,0,0.1);
            box-shadow: inset 0 2px 2px rgba(0,0,0,0.1);
    }
    
    .checkbox:checked {
            background: #fff;
    }
    
    .checkbox:checked::after {
            content: url(../images/blue.png);
            position: absolute;
            top: -1px;
            right: 0px;
            left: -1px;
            display: block;        
    }
    .checkbox:focus {
            outline: none;
            border-color: #DADADA;
    }
     .radio{
            -webkit-appearance: none;
            appearance: none;
             18px;
            height: 18px;
            border-radius:10px;
            margin: 0;
            cursor: pointer;
            vertical-align: bottom;
            background: #fff;
            border: 1px solid #DADADA;
            -webkit-border-radius:10px;
            -moz-border-radius:10px;
            -webkit-box-sizing: border-box;
            position: relative;
            overflow:hidden;
    }
    
    .radio:active {
            border-color: #DADADA;
            background: #ebebeb;
    }       
            
    .radio:hover {
            border-color: #0E76A8;
            -webkit-box-shadow: inset 0 2px 2px rgba(0,0,0,0.1);
            -moz-box-shadow: inset 0 2px 2px rgba(0,0,0,0.1);
            box-shadow: inset 0 2px 2px rgba(0,0,0,0.1);
    }
    
    .radio:checked {
            background: #fff;
    }
    
    .radio:checked::after {
            content: url(../images/blue.png);
            position: absolute;
            top:-1px;
            right: 0px;
            left: -21px;
            display: block;
                    
    }
    .radio:focus {
            outline: none;
            border-color: #DADADA;
    }


    用到的图片


  • 相关阅读:
    判断回溯法中的标记数组vis在回溯的时候是否要取消标记?
    Linux多线程开发I
    答题小程序开发
    答题活动小程序
    今天来谈谈答题小程序的上下游生态
    挑战答题小程序V2.0
    可以免费出题的答题小程序
    挑战答题小程序上线了
    通过小程序反编译来谈谈小程序的分包加载机制?
    本文介绍下答题小程序V6.0
  • 原文地址:https://www.cnblogs.com/yanergui/p/5624757.html
Copyright © 2020-2023  润新知