css重点16:设置Input:chechkbox的样式改成圆角 修改里面的内容

html

<input type="checkbox" />

css

 input[type="checkbox"] {
     
            width: 1.64rem;
            height: 1.64rem;
            display: inline-block;
            text-align: center;
            vertical-align: baseline;
            line-height: 1.64rem;
            position: relative;
            border-radius: 50%;
            outline: none;
            -webkit-appearance: none;
            ​border: 1px solid #fff;
            -webkit-tab-highlight-color: rgba(0, 0, 0, 0);
            color: #fff;
            background: #fff;
            margin-left: 3px;

        }

        input[type="checkbox"]::before {
     
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            background: #fff;
            width: 100%;
            height: 100%;
            border: 1px solid #999999;
            border-radius: 50%;
            color: #fff;
            margin-top: 5px;
        }

        input[type=checkbox]:checked::before {
     
            content: "\2713";
            /* background-color: #657afe; */
            border: 1px solid #657afe;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            color: green;
            font-size: 1.52rem;
            border-radius: 50%;
        }

效果图:

css重点16:设置Input:chechkbox的样式改成圆角 修改里面的内容_第1张图片

你可能感兴趣的:(css)