http://codepen.io/dcdev/full/toBzb/
Green when unchecked, red when checked.. This works by actually hiding the default checkbox and styling the label over to of the hidden checkbox to look like a checkbox.
label {
position: absolute;
width: 20px;
height: 20px;
background-color: green;
-webkit-transition: background-color 1s ease-out 1s;
-moz-transition: background-color 1s ease-out 1s;
-o-transition: background-color 1s ease-out 1s;
transition: background-color 1s ease-out 1s;
}
.checkbox_red input[type=checkbox]:checked + label {
background-color:red;
-webkit-transition: background-color 1s ease-out 1s;
-moz-transition: background-color 1s ease-out 1s;
-o-transition: background-color 1s ease-out 1s;
transition: background-color 1s ease-out 1s;
}
.checkbox_red label:after {
position: absolute;
bottom: 8px;
width: 18px;
height: 10px;
opacity: 0;
content: '';
background: transparent;
border: 3px solid #000;
border-top: none;
border-right: none;
-webkit-transform: rotate(-50deg);
-moz-transform: rotate(-50deg);
-ms-transform: rotate(-50deg);
-o-transform: rotate(-50deg);
transform: rotate(-50deg);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
.checkbox_red input[type=checkbox] {
visibility: hidden;
}
.checkbox_red input[type=checkbox]:checked + label:after {
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
}
and the html
<div class="checkbox_red">
<input type="checkbox" value="none" id="checkbox_red1" name="check">
<label for="checkbox_red1"></label>
</div>