Possible Duplicate:
CSS content generation before ‘input’ elements
I am trying to do custom checkboxes only using css. This works fine on webkit based browsers (chrome, safari), but doesn't on the others.
input[type=checkbox]:before {
content:'';
display:inline-block;
width:24px;
height:24px;
margin-top:-8px;
margin-left:-12px;
background: url('../img/icons/checkbox_unchecked.png') left center no-repeat;
border: 1px solid gray;
}
input[type=checkbox]:checked:before {
background: url('../img/icons/checkbox_checked.png') left center no-repeat;
}
Why does this only work on webkit based browsers? http://jsfiddle.net/jdB4a/ here's the jsfiddle, I just changed the images to background color, the effect is the same though.