I've got a checkbox list for payment examples
<input type='checkbox' name='methods' value='valuable' id="Paypal"/><label id="PaypalL" for="Paypal"></label>
<input type='checkbox' name='methods' value='valuable' id="MasterCard"/><label id="MasterCardL" for="MasterCard"></label>
<input type='checkbox' name='methods' value='valuable' id="Visa"/><label id="VisaL" for="Visa"></label>
I'd like to replace the checkbox image with a pair of custom on/off images and I was wondering if anyone had some better understanding of how to do this with CSS? each image check box will need a different set of image pair is there in a less code way
input[type=checkbox] {
display:none;
}
input[type=checkbox] + #PaypalL
{
background: url('PayPalOff.png') 0 0px no-repeat;
height: 40px;
width: 64px;
display:block;
padding: 0 0 0 0px;
}
input[type=checkbox]:checked + #PaypalL
{
background: url('PayPalOn.png') 0 0px no-repeat;
height: 40px;
width: 64px;
padding: 0 0 0 0px;
}
#MasterCard + #MasterCardL
{
background: url('MasterCardOff.png') 0 0px no-repeat;
height: 40px;
width: 64px;
display:block;
padding: 0 0 0 0px;
}
#MasterCard:checked + #MasterCardL
{
background: url('MasterCardOn.png') 0 0px no-repeat;
height: 40px;
width: 64px;
padding: 0 0 0 0px;
}
#Visa + #VisaL
{
background: url('VisaOff.png') 0 0px no-repeat;
height: 40px;
width: 64px;
display:block;
padding: 0 0 0 0px;
}
#Visa:checked + #VisaL
{
background: url('VisaOn.png') 0 0px no-repeat;
height: 40px;
width: 64px;
padding: 0 0 0 0px;
}
this is what i have come up with so far