其他分享
首页 > 其他分享> > css自定义复选框样式

css自定义复选框样式

作者:互联网

5.jpg

代码:

/*复选框样式*/
input[type=checkbox]{
    -webkit-appearance: none;
    vertical-align:middle;
    margin-top:0;
    border:#1e89e4 solid 1px;
    border-radius: 3px;
    min-height: 12px;
    min-width: 12px;
    outline: none;
    position: relative;
}
input[type=checkbox]:checked::after{
    content: '';
    top: 3px;
    left: 2px;
    position: absolute;
    background: transparent;
    border: #fff solid 2px;
    border-top: none;
    border-right: none;
    height: 4px;
    width: 8px;
    -moz-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
    color:#fff;
}

效果:

6.jpg

标签:none,rotate,自定义,45deg,transform,复选框,border,top,css
来源: https://blog.51cto.com/11871779/2369808