css input[type="checkbox"].html

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>css input[type="checkbox"]</title>
    <style>
        /*参考:https://blog.csdn.net/qq_41184533/article/details/96836114*/
        * {
            margin: 0;
            padding: 0;
        }

        input[type="checkbox"] {
            outline: none;
            -webkit-appearance: none;
            position: relative;
            vertical-align: -18%;
            border: 1px solid rgb(68, 82, 213);
            /*border-radius: 2px;*/
            min-height: 20px;
            min-width: 20px;
        }

        input[type="checkbox"]:checked {
            /*border: 1px solid #ededed;*/
            /*outline: none;*/
        }

        input[type=checkbox]:checked:after {
            content: '\2714';
            position: absolute;
            left: 4px;
            background: transparent;
            color: rgb(68, 82, 213);
            line-height: 20px;
        }
    </style>
</head>
<body>
<input type="checkbox" name="saveUserName_password"> <span>记住用户名和密码</span>
</body>
</html>




发布了198 篇原创文章 · 获赞 58 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/weixin_42193179/article/details/103685115
今日推荐