zoukankan      html  css  js  c++  java
  • css3单选 复选按钮--代码分享

    1.html

    <div>
    <input type="checkbox" id="option"/>
    <label for="option"> <span></span> 点击1 </label>
    </div>
    <div>
    <input type="radio" name="my-radio" id="radio-option-1"/>
    <label for="radio-option-1"> <span></span> 点击2 </label>
    </div>
    <div>
    <input type="radio" name="my-radio" id="radio-option-2"/>
    <label for="radio-option-2"> <span></span> 点击3</label>
    </div>



    2.css

    body {
    font-family: "Verdana", sans-serif;
    background-color: #eee;
    padding: 50px;
    font-size: 30px;
    }
    div {
    margin-bottom: 1em;
    }
    input[type="checkbox"], input[type="radio"] {
    display: none;
    }
    label {
    cursor:pointer;
    color: #555;
    }
    input[type="checkbox"]:checked + label,
    input[type="radio"]:checked + label {
    color: deepPink;
    }
    input[type="checkbox"] + label span,
    input[type="radio"] + label span {
    display: inline-block;
    vertical-align: middle;
    45px;
    height: 45px;
    border: 2px solid #888;
    border-radius: 10px;
    background: radial-gradient(#eee, #aaa);
    }

    input[type="checkbox"] + label span:hover,
    input[type="radio"] + label span:hover{
    box-shadow: 0px 0px 10px #000;
    }
    input[type="checkbox"]:checked + label span:hover,
    input[type="radio"]:checked + label span:hover{
    border: 2px solid #c3ff65;
    }

    input[type="radio"] + label span {
    border-radius: 50%;
    }
    input[type="checkbox"] + label span::before {
    content: "";
    display: block;
    }

    input[type="checkbox"]:checked + label span::before {
    content: "✓";
    color: deepPink;
    text-align: center;
    font-size: 40px;
    }
    input[type="radio"]:checked + label span {
    background-image: radial-gradient(#FF5ABA, deepPink);
    }



  • 相关阅读:
    Java开发中的23种设计模式详解
    Zookeeper基本知识
    Zookeeper命令
    ZooKeeper原理及使用
    几种java通信(rmi,http,hessian,webservice)协议性能比较
    linux 查看系统信息命令
    Zookeeper安装和配置
    Hive 接口介绍(Web UI/JDBC)
    窗口标志-外观
    pyqt5-QWidget-窗口状态(最大化最小化等)
  • 原文地址:https://www.cnblogs.com/fcan/p/4857097.html
Copyright © 2011-2022 走看看