zoukankan      html  css  js  c++  java
  • 单选框、复选框 自定义样式----------关键属性无注释说明,可调试自觉添加

    /*radio与checkbox*/
    [type="radio"]:not(:checked),
    [type="radio"]:checked {position: absolute; left: -9999px; }
    [type="radio"]:not(:checked)+ label,
    [type="radio"]:checked+ label {position: relative; padding-left: 22px; cursor: pointer; padding-right: 6px; }
    [type="radio"]:not(:checked)+ label:before,
    [type="radio"]:checked+ label:before {content: ''; position: absolute; left: 2px; top: 3px;  13px; height: 13px; border: 1px solid #aaa; background: #0d3466; border-radius: 30px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3); line-height: 150%; font-size: 12px; border: 1px solid #5ebeff; }
    .cssVal{border: 1px solid #5ebeff; }
    [type="radio"]:not(:checked)+ label:after,
    [type="radio"]:checked+ label:after {display: block;  7px; height: 7px; border-radius: 50%; content: ' '; position: absolute; top: 7px; left: 6px; background: #5ebeff; transition: all .2s; }
    [type="radio"]:not(:checked)+ label:after {opacity: 0; transform: scale(0); }
    [type="radio"]:checked+ label:after {opacity: 1; transform: scale(1); }
    [type="radio"]:disabled:not(:checked)+ label:before,
    [type="radio"]:disabled:checked+ label:before {box-shadow: none; border-color: #bbb; background-color: #ddd; }
    [type="radio"]:disabled:checked+ label:after {color: #999; }
    [type="radio"]:disabled+ label {color: #aaa; }
    [type="radio"]:checked:focus+ label:before,
    [type="radio"]:not(:checked):focus+ label:before {}
    [type="radio"]:not(:checked), [type="radio"]:checked {position: absolute; left: -9999px; } 
    
    [type="checkbox"]:not(:checked), [type="checkbox"]:checked {position: absolute; left: -9999px; }
    .tableStyleWordWrap [type="checkbox"]:not(:checked),
    .tableStyleWordWrap [type="checkbox"]:checked {position: absolute; padding-left: 0; left: 0; margin-left: -1px; }
    .tableStyleWordWrap input[type="checkbox"]:before{content:""; position: absolute; top: -1px; left: 9999px;  12px; height: 12px; border: 1px solid #fff; background-color: transparent;border-radius: 2px;}
    [type="checkbox"]:not(:checked)+ label,
    [type="checkbox"]:checked+ label {position: relative; padding-left: 25px; cursor: pointer; }
    .tableStyleWordWrap [type="checkbox"]:not(:checked),
    .tableStyleWordWrap [type="checkbox"]:checked {position: relative; padding-left: 25px; cursor: pointer;left: -10000px;}
    [type="checkbox"]:not(:checked)+ label:before{content: ''; position: absolute; left: 4px; top: 3px;  13px; height: 13px; background: #0d3466; border-radius: 2px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3); line-height: 150%; border: 1px solid #5ebeff; }
    .tableStyleWordWrap [type="checkbox"]:not(:checked) :before{content: ''; position: absolute; left: -2px; top: -2px;  13px; height: 13px; background: #fff; border-radius: 2px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3); line-height: 150%; border: 1px solid #ccc; }
    [type="checkbox"]:checked+ label:before {content: ''; position: absolute; left: 4px; top: 3px;  13px; height: 13px; background: #0d3466; border-radius: 2px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3); line-height: 150%; border: 1px solid #5ebeff; }
    .tableStyleWordWrap [type="checkbox"]:checked:before {content: ''; position: absolute; left: 9999px; top: -1px;  12px; height: 12px;background-color: transparent; border-radius: 2px; /*box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3);*/ line-height: 150%; border: 1px solid #fff; }
    [type="checkbox"]:not(:checked)+ label:after,
    [type="checkbox"]:checked+ label:after {content: '✔'; position: absolute; top: 2px; left: 6px; font-size: 12px; color: #fff; transition: all .2s; line-height: 150%; }
    .tableStyleWordWrap [type="checkbox"]:not(:checked):after,
    .tableStyleWordWrap [type="checkbox"]:checked:after {content: '✔'; position: absolute; top: -2px; left: 10001px; font-size: 12px; color: #fff; transition: all .2s; line-height: 150%; }
    [type="checkbox"]:not(:checked)+ label:after {opacity: 0; transform: scale(0); }
    .tableStyleWordWrap [type="checkbox"]:not(:checked):after {opacity: 0; transform: scale(0); }
    [type="checkbox"]:checked+ label:after {opacity: 1; transform: scale(1); }
    .tableStyleWordWrap [type="checkbox"]:checked:after {opacity: 1; transform: scale(1); }
    [type="checkbox"]:disabled:not(:checked)+ label:before,
    [type="checkbox"]:disabled:checked+ label:before {box-shadow: none; border-color: #bbb; background-color: #ddd; }
    .tableStyleWordWrap [type="checkbox"]:disabled:not(:checked):before,
    .tableStyleWordWrap [type="checkbox"]:disabled:checked:before {box-shadow: none; border-color: #bbb; background-color: #ddd; }
    [type="checkbox"]:disabled:checked+ label:after {color: #999; }
    .tableStyleWordWrap [type="checkbox"]:disabled:checked:after {color: #999; }
    [type="checkbox"]:disabled+ label {color: #aaa; }
    .tableStyleWordWrap [type="checkbox"]:disabled+ label {color: #aaa; }
    [type="checkbox"]:checked:focus+ label:before,
    [type="checkbox"]:not(:checked):focus+ label:before {}
    
    /*radio与checkbox*/
    

      

  • 相关阅读:
    电脑磁盘分区助手:DiskGenius磁盘管理与数据恢复软件
    python安装第三方的包
    教你成为全栈工程师(Full Stack Developer) 四十五-一文读懂hadoop、hbase、hive、spark分布式系统架构
    北半球 自己动手做聊天机器人
    [08] 请求、会话、上下文属性比较
    [07] ServletContext上下文对象
    [06] Session实现机制以及和Cookie的区别
    [05] Session概要
    [04] Cookie概念和基本使用
    [03] Servlet继承关系和生命周期
  • 原文地址:https://www.cnblogs.com/janfu/p/8302925.html
Copyright © 2011-2022 走看看