您的位置:首页 > Web前端 > CSS

改变 input 的 checkbox 的 样式

2018-09-26 09:47 267 查看

 

   效果图

 

html  样式

<div id="check_css">

<span><input type="checkbox" class="input_check" /><label></label></span>

</div>

 

 

css 样式

#check_css {

display: flex;

}

#check_css  span:first-child {position: relative;}

#check_css .input_check {position: absolute;width: 30px;

height: 30px;

opacity: 0;

top: 10px;

left:3px;

z-index: 10;

cursor: pointer;

}

#check_css .input_check+label {

display: inline-block;

margin-top:5px;

width: 30px;

height: 30px;

border: 1px solid #CCC;

border-radius:50%;

}

#check_css .input_check:checked + label::after {

position: absolute;

left: 10px;

top:1px;

width: 9px;height: 6px;

content: "\2714";

color: #39e60e;

display: block;

border-top-color: transparent;

border-right-color: transparent;

-ms-transform: rotate(5deg);

-moz-transform: rotate(5deg);

-webkit-transform: rotate(5deg);

transform: rotate(5deg);

}

阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: