美文网首页
checkbox选中效果自定义大小和颜色

checkbox选中效果自定义大小和颜色

作者: 每天进步一点点5454 | 来源:发表于2021-08-17 09:23 被阅读0次
    image.png
    image.png
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
                    .pay_stylestyle input[type="checkbox"] {
                width: 20px;
                height: 20px;
                display: inline-block;
                text-align: center;
                vertical-align: middle;
                line-height: 18px;
                position: relative;
            }
    
            .pay_stylestyle input[type="checkbox"]::before {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                background: #fff;
                width: 86%;
                height: 86%;
                border: 1px solid #d9d9d9;
            }
    
            .pay_stylestyle input[type="checkbox"]:checked::before {
                content: "\2713";
                background-color: #fff;
                position: absolute;
                top: 0px;
                left: 0;
                width: 86%;
                height: 86%;
                border: 1px solid #3A71FF;
                color: #fff;
                font-size: 13px;
                font-weight: bold;
                background: #3A71FF;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        </style>
        
    
        </style>
    </head>
    <body>
        <div class="pay_stylestyle">
            <input type="checkbox">
        </div>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:checkbox选中效果自定义大小和颜色

          本文链接:https://www.haomeiwen.com/subject/qeubbltx.html