使用 CSS 修改 HTML 默认单选(radio)和复选框(checkbox)样式(网页版)

<label for="remmber">
    <input class="remmber" type="checkbox" name="remmber" id="remmber">
    <span></span>
    记住密码
</label>

.remmber[type=checkbox]+span {
display: inline-block;
border-radius: .05rem;
width: .28rem;
height: .28rem;
border: .02rem solid #0D1529;
color: #0D1529;
position: absolute;
top: 0;
left: -.5rem;
}
.remmber[type=checkbox]:checked+span:after { content: '\2714'; position: absolute; font-size: 0.28rem; left: 0.05rem; }

 

 

posted @ 2022-03-25 14:57  小小强学习网  阅读(381)  评论(0编辑  收藏  举报