I have the following html:
<ul class="payment-methods">
<li class="payment-method paypal">
<input name="payment_methods" type="radio" id="paypal">
<label for="paypal"></label>
</li>
<li class="payment-method pagseguro">
<input name="payment_methods" type="radio" id="pagseguro">
<label for="pagseguro"></label>
</li>
<li class="payment-method boleto">
<input name="payment_methods" type="radio" id="boleto">
<label for="boleto"></label>
</li>
</ul>
That shows payment methods.
In it, radio buttons
is display:none
so labels
is shown instead.
Is there a way I can force at least 1 button to be ticked even though they are with display:none
?
CSS
@charset"utf-8";
/* CSS Document */
.divCheckList .valorBool,
.divCheckList .divCheckBox {
height: 34px;
display: inline-block;
border: rgb(222,222,222) 1px solid;
vertical-align: middle;
}
.divCheckList .valorBool {
line-height: 34px;
}
.divCheckList .labelCheckBox {
position: relative;
display: block;
width: 60px;
height: 34px;
background-color: rgb(222,222,222);
border: none;
border-radius: 34px;
-webkit-transition: .4s;
transition: .4s;
cursor: pointer;
}
.divCheckList .labelCheckBox:before {
position: absolute;
display: block;
width: 26px;
height: 26px;
background-color: #FFF;
border-radius: 50%;
content: "";
margin: 4px;
-webkit-transition: .4s;
transition: .4s;
}
.divCheckList .divCheckBox .checkBox:checked + .labelCheckBox {
background-color: blue;
}
.divCheckList .divCheckBox .checkBox:checked + .labelCheckBox:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}