zoukankan      html  css  js  c++  java
  • 改变默认的多选框 checkbox 样式~

     效果图:

     

    HTML代码:
    <label for="Checkbox1" style="display:none;"></label>
    <input type="checkbox" id="Checkbox1" value="option1" class="input_check">
    CSS代码:
    /* 复选框checkbox */
    .input_check {
        -moz-appearance: none;
        appearance: none;
        -webkit-appearance: none;
        outline: none;
        display: none;
    }
    /* 未选 */
    .input_check{
        display: inline-block;
        border: 1px solid #ccc;
        border-radius: 4px;
        width: 18px;
        height: 18px;
    }
    input[type=file]:focus, input[type=checkbox]:focus, input[type=radio]:focus{
        outline: none;    /* outline (轮廓)是绘制于元素周围的一条线,位于边框边缘的外围,可起到突出元素的作用。outline 属性设置元素周围的轮廓线。*/
    }
    /* 鼠标滑过未选 */
     input[type=file]:hover, input[type=checkbox]:hover, input[type=radio]:hover{
        border-color: #3bb8f6;
    } 
    /* 已选 */
    .input_check:checked {
        display: inline-block;
        background-image: url('../../../assets/img/checkbox2.png');
        background-repeat: no-repeat;  
        background-position: 0px 0px; 
        width: 18px;
        height: 18px;
        border: none;
    } 
    /* 鼠标滑过已选 */
    .input_check:checked:hover{
        display: inline-block;
        background-image: url('../../../assets/img/checkbox1.png');
        background-repeat: no-repeat;  
        background-position: 0px 0px; 
        width: 18px;
        height: 18px;
        border: none;
        outline: none;
    }
  • 相关阅读:
    cisco 4500X 交换机限速
    HPE 交换机基础配置
    MySQL数据库之主从复制
    MySQL复制线程状态转变
    MySQL数据库备份之mysqldump
    MySQL数据库之慢查询日志
    MySQL数据库之多线程备份工具mydumper
    MySQL数据库之索引
    MySQL之二进制日志
    MySQL数据库之sql_mode解释
  • 原文地址:https://www.cnblogs.com/luwanying/p/9469611.html
Copyright © 2011-2022 走看看