All,
I have a checkbox that I applied the following CSS style to:
-webkit-appearance: none;
This same code is on some text fields I have and these still continue to work just fine. Why is this functionality causing the checkbox to not allowed to be checked?
I like the styling of the checkbox this way but still need the functionality to work. If I change the code to:
-webkit-appearance: checkbox;
It displays the standard checkbox. Any ideas? Here is a demonstration:
/* http://jsfiddle.net/VWC76/ */
input[type='checkbox'] {
height: 20px;
border: 1px solid #B5B7B8;
font: 14px/26px 'pt-sans', 'Helvetica Neue', Arial, Helvetica, Geneva, sans-serif;
padding: 7px 7px 7px 12px;
/*margin:0 0 30px 0;*/
background: #FFF;
border: 1px solid #d5d5d6;
outline: none;
color: #96999D;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
-webkit-appearance: none;
-webkit-font-smoothing: antialiased;
border-radius: 4px;
transition: all 0.15s;
}
input[type=checkbox]:focus {
border-color: #ACACB8;
color: #2E3236;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18)!important;
}
div {
border: 1px inset #ccc;
border-radius: 7px;
margin: 1em;
padding: 1em;
}
#webkitCheckbox {
-webkit-appearance: checkbox;
}
<div>
<label>
<input type="checkbox" />
<span>This has <code>-webkit-appearance: none;</code></span>
</label>
</div>
<div>
<label>
<input type="checkbox" id="webkitCheckbox" />
<span>This has <code>-webkit-appearance: checkbox;</code></span>
</label>
</div>