I want that the background inner color of the radio buttons are the same as the background color of the container, and no border around the selection.
I tried with background color, color, but didn’t work.
In the HTML the buttons are not into a form tag, by now I don’t need it, I’ve even tried to add it to see if something changed but without results, any idea?
I know i can just put normal buttons styling easier, but i want the "one-only" selection. I could code it in JS but if possible to style the radio button is better!
Current situation:
Desired result:
.radioButton {
background-color: rgb(37, 45, 68);
border-radius: 50px;
}
input {
accent-color: red;
}
<div class="radioButton">
<input type="radio" id="color1" name="color" checked="true">
<input type="radio" id="color2" name="color">
<input type="radio" id="color3" name="color">
</div>
2
Answers
Hide
<input>
then add<span>
, styling the<span>
.Remember to wrap
<span>
and<input>
in<label>
so the radio input will be checked when<span>
was clicked.You can use CSS appearance: none to remove the browser default styling and then add in your own: