Wednesday, February 24th, 2010
Custom checkbox and radio buttons using CSS
<blockquote>In my never ending quest to find weird and wonderful ways to abuse CSS and all its little intricacies, I have come up with a pretty good way of using CSS to create custom radio and checkbox inputs without JavaScript, that are accessible, keyboard controlled, don’t use any hacks and degrade nicely in non supporting browsers. The journey wasn’t easy and I was on the brink of filing it in the “to crazy” folder, never to be seen again. Luckily I had a brain wave that paid off and actually allowed this to be a very viable solution that degrades beautifully and works in 80% of the browsers. This is my story.

Ryan "the CSS Ninja" goes from here to explain his quest which includes fun CSS such as:
CSS:
-
-
p:not(#foo)> input + label:before
-
{
-
background: url(gr_custom-inputs.png) 0 -1px no-repeat;
-
position: absolute;
-
z-index: 2;
-
left: 16px;
-
content: "