I\'m trying to specify an image to be used for my unchecked and checked values for html input type checkbox and radio.
I have got this:
background: u
Here is how I did it. I'm using radio input. The input boxes are hidden and the image in each label changes when the input is selected/not selected.
Jsfiddle: http://jsfiddle.net/EhDsf/
HTML:
CSS:
div.options > label > input {
visibility: hidden;
}
div.options > label {
display: block;
margin: 0 0 0 -10px;
padding: 0 0 48px 0;
height: 20px;
width: 150px;
}
div.options > label > img {
display: inline-block;
padding: 0px;
height:60px;
width:60px;
background: url(https://cdn2.iconfinder.com/data/icons/snipicons/500/thumbs-down-128.png);
background-repeat: no-repeat;
background-position:center center;
background-size:60px 60px;
}
div.options > label > input:checked +img {
background: url(https://cdn1.iconfinder.com/data/icons/onebit/PNG/onebit_34.png);
background-repeat: no-repeat;
background-position:center center;
background-size:60px 60px;
}