2
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, the radio buttons
are with display:none
so that the labels
are shown in their place.
There is a way for me to force at least 1 button, to be marked even if 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);
}
And if you put the property
checked
what happens?– Woss
There is no way to put checked in dislay:None. Can’t find the object!
– Carlos Rocha