CSS设置input默认样式

HTML

    <ul class="box">
        <li>
            <input type="checkbox" name="vehicle" id="vehicle">
            <label for="vehicle">第一个选项</label>
        </li>
        <li>
            <input type="checkbox" name="vehicle" id="vehicle2">
            <label for="vehicle2">第二个选项</label>
        </li>
    </ul>

CSS

    ul,
    li {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .box input[type="checkbox"] {
        width: 12px;
        height: 12px;
        border: 1px solid #e2e2e2;
        background: none;
        box-shadow: none;
    }

    .box input[type="checkbox"] {
        -webkit-appearance: none;
        appearance: none;
        display: inline-block;
        margin: 0 2px 2px 0;
        width: 12px;
        height: 12px;
        cursor: pointer;
        outline: none;
        vertical-align: middle;
        border: 1px solid #e2e2e2;
    }

    .box input:checked {
        border: 1px solid #13af13;
    }
    .box input:checked::before {
        content: "";
        display: block;
        position: relative;
        width: 3px;
        height: 6px;
        left: 34%;
        top: 9%;
        border-right: 1px solid #13af13;
        border-bottom: 1px solid #13af13;
        transform: rotate(45deg);
        background: none;
    }

 

转载于:https://www.cnblogs.com/xueyunNO1/p/9487537.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值