更改复选框的颜色边框

时间:2016-09-14 11:56:42

标签: checkbox colors

我必须更改复选框边框的颜色。

这是图片:change border checkbox

我寻求和我在网上寻找但我没有找到如何做到这一点: - (

1 个答案:

答案 0 :(得分:0)

查看我从JSFiddle

中偷走的This answer on StackOverflow.

这里是CSS:

.styled-checkbox {
   opacity: 0;
   filter: alpha(opacity=0);
}
.styled-checkbox + label {
   position: relative;
}
.styled-checkbox + label:before,
.lt-ie8 .checkbox-replacement {
   content: '';
   display: inline-block;
   visibility: visible;
   left: 0;
   width: 0.6em;
   height: 0.6em;
   margin: 0 0.3em 0 -1em;
   line-height: 0.6;
   text-align: center;
   border: 1px solid red;
 }
.styled-checkbox:checked + label:before,
.lt-ie9 .styled-checkbox.checked + label:before {
   content: '\2713';
 }