<div>
<input type="checkbox" name="choice1" checked />
<input type="checkbox" name="choice2" class="error" />
</div>
<!--
class "error" is used to change gray color to red
two different style, which is your favorite?
-->
div{
margin: 0 auto;
margin: 80px 0;
text-align: center;
}
input[type='checkbox'] {
display:block;
margin: 0 auto;
margin-bottom: 10px;
appearance: button;
border:none;
background: url(http://www.pixelslip.be/img/check.png) no-repeat 0 0 transparent;
background-color: #ccc;
width: 90px;
height: 40px;
border-radius: 3px;
box-shadow: inset 0 1px 4px rgba(0,0,0,.2);
cursor: pointer;
position: relative;
transition: background-color 1s;
}
input[type='checkbox'].error{
background-color: #c63d3d;
}
input[type='checkbox']:after{
content: "";
display: block;
position: absolute;
top: 0;
left: 0;
width: 45%;
height: 80%;
background-color: #fdfdfd;
margin: 4%;
border-radius: 3px;
box-shadow: 0 1px 2px rgba(0,0,0,.2);
background: rgb(255,255,255);
background: linear-gradient(top, rgba(255,255,255,1) 0%, rgba(243,243,243,1) 100%);
background: gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(243,243,243,1)));
background: linear-gradient(top, rgba(255,255,255,1) 0%,rgba(243,243,243,1) 100%);
background: linear-gradient(top, rgba(255,255,255,1) 0%,rgba(243,243,243,1) 100%);
background: linear-gradient(top, rgba(255,255,255,1) 0%,rgba(243,243,243,1) 100%);
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(243,243,243,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f3f3f3',GradientType=0 );
transition: .5s all;
}
input[type='checkbox']:checked{
background-color: #79d122;
}
input[type='checkbox']:checked:after {
left: 45%;
}
/* webkit optimisation - just css */
This Pen doesn't use any external CSS resources.