zoukankan      html  css  js  c++  java
  • 原生 input radio 优化

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <title></title>
        </head>
        <style type="text/css">
            div {
              position: relative;
              line-height: 30px;
            }
            
            input[type="radio"] {
              width: 20px;
              height: 20px;
              opacity: 0;
            }
            
            label {
              position: absolute;
              left: 5px;
              top: 8px;
              width: 20px;
              height: 20px;
              border-radius: 50%;
              border: 1px solid #999;
            }
            
            /* 这只check 之后的样式 */
            input:checked+label {
              background-color: #0090FF;
              border: 1px solid #0090FF;
            }
            
            input:checked+label::after {
              position: absolute;
              content: "";
              width: 5px;
              height: 10px;
              top: 3px;
              left: 6px;
              border: 2px solid #fff;
              border-top: none;
              border-left: none;
              transform: rotate(45deg)
            }
        </style>
        <body>
        <form>
              <div>
                <input id="nan" type="radio" name="sex" checked>
                <label for="nan"></label>
                <span style="margin-left: 10px"></span>
              </div>
              <div>
                <input id="nv" type="radio" name="sex">
                <label for="nv"></label>
                <span style="margin-left: 10px"></span>
              </div>
            </form>
        </body>
    </html>
  • 相关阅读:
    3.2.1 webpack-dev-server的使用
    打印预览及打印
    2.1.8 webpack的环境
    常用docker 启动
    github镜像
    Log解析
    【Bzoj4555】【Luogu P4091】求和(NTT)
    【Bzoj3527】【Luogu3338】[Zjoi2014]力(FFT)
    FFT实现高精度乘法
    Bzoj 2190 仪仗队(莫比乌斯反演)
  • 原文地址:https://www.cnblogs.com/wxhhts/p/12054891.html
Copyright © 2011-2022 走看看