Working and expandable code. Live Demo
The name of all radio
buttons should be same for them to work as a group. I have added class="class1"
to normal entries and class="class2"
to special entry.
HTML
<li>
<input class="class1" type="radio" id="radio" name="radios" checked />
<label for="radio">Apples</label>
</li>
<li>
<input class="class1" type="radio" id="radio2" name="radios" />
<label for="radio2">Pineapples </label>
</li>
<li>
<input class="class1" type="radio" id="radio3" name="radios" />
<label for="radio3">Pomarance</label>
</li>
<li>
<input class="class2" type="radio" id="nekaj" name="radios" />
<label for="nekaj">Pomarance123</label>
</li>
CSS
input[type="radio"][class="class1"] + label:before {
content: '2';
display:inline-block;
width: 32px;
height: 32px;
background: url(http://dl.dropbox.com/u/51558405/radio-checked.png) no-repeat;
vertical-align: middle;
}
input[type="radio"][class="class1"]:checked + label:before {
content: '3';
background: url(http://dl.dropbox.com/u/51558405/radio-unchecked.png) no-repeat;
}
input[type="radio"][class="class2"] + label:before {
content: '444';
display:inline-block;
width: 32px;
height: 32px;
background: url(http://www.clker.com/cliparts/M/2/V/6/F/u/radiobutton-checked-sm-th.png) no-repeat;
background-size:100% auto;
vertical-align: middle;
}
input[type="radio"][class="class2"]:checked + label:before {
content: '444';
display:inline-block;
width: 32px;
height: 32px;
background: url(http://www.clker.com/cliparts/M/2/V/6/F/u/radiobutton-checked-sm-th.png) no-repeat;
background-size:100% auto;
vertical-align: middle;
}