css 修改 input checkbox样式 及 文字禁止选中

css 修改 input checkbox样式 及 文字禁止选中

css 修改 input checkbox样式

效果
checked效果

input[type="checkbox"]{
    -webkit-appearance: none;
    vertical-align:middle;
    margin-top:0;
    background: none;
    border:#fff solid 2px;
    border-radius: 3px;
    min-height: 16px;
    min-width: 16px;
}
/* 下面这个可以注释掉 只是想以后要改的时候方便些 */
input[type="checkbox"]:checked {
    background: none;
} 

input[type=checkbox]:checked::after{
    position: absolute;
    content: '';
    top: 4px;
    left: 2px;
    border: #fff solid 2px;
    border-top: none;
    border-right: none;
    height: 8px;
    width: 10px;
    -moz-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
    -o-transform: rotate(-45deg); 
    transform: rotate(-45deg);
} 

原文: css input checkbox样式更改

css设置禁止文字被选中

-moz-user-select: none; 
-o-user-select:none; 
-khtml-user-select:none; 
-webkit-user-select:none; 
-ms-user-select:none; 
user-select:none;

原文:css设置禁止文字被选中

或与有人会问,已经有了你为什么还要再发,抱歉,我只是为了方便我自己,以后就不用再在百度上找了,也就是自己的学习笔记。有一点小私心了 (AvA)。

猜你喜欢

转载自blog.csdn.net/Vision_Pinna/article/details/82807028
今日推荐