zoukankan      html  css  js  c++  java
  • 自定义多选框(checkbox)和单选框(radio)css样式

    直接上代码:

    input[type="radio"],input[type="checkbox"]{
      -webkit-appearance: none;
      outline: none;
    }
    input[type="radio"]{
      position: relative;
      width: .12rem;
      height: .12rem;
      border: 1px solid #186D9A;
      border-radius: .06rem;
      -webkit-border-radius: .06rem;
      -moz-border-radius:.06rem;
      vertical-align: middle;
      background: white;
    }
    
    input[type="radio"]:checked:after {
      content: '';
      position: absolute;
      left: .02rem;
      top: .02rem;
      width: .06rem;
      height: .06rem;
      background-color: #186D9A;
      border-radius: .03rem;
      -webkit-border-radius: .03rem;
      -moz-border-radius:.03rem;
    }
    input[type="radio"]:checked {
      background-color: #fff;
    }
    input[type="checkbox"] {
      position: relative;
      width: .12rem;
      height: .12rem;
      border: .01rem solid #186D9A;
      border-radius: .02rem;
      vertical-align: middle;
      background: white;
      margin-top: 0;
    }
    input[type="checkbox"]:checked:after {
      content: '';
      position: absolute;
      left: .02rem;
      top: .02rem;
      width: .07rem;
      height: .04rem;
      border-left: .02rem solid #186D9A;
      border-bottom: .02rem solid #186D9A;
      transform: rotate(-45deg);
    }
    input[type="checkbox"]:checked {
      background-color: #fff;
    }
  • 相关阅读:
    链表相交
    环路检测
    lambada表达式对集合的过滤和相互转换
    lambda表达式对集合的遍历
    centos7常用命令
    小程序文件
    扫码登录
    位操作
    使用json-lib转换对象为字符串时的特殊处理
    javac 编译异常总结
  • 原文地址:https://www.cnblogs.com/SPHmomo/p/6913490.html
Copyright © 2011-2022 走看看