Style radio buttons to match your site’s design while maintaining accessibility.
Source Code
.radio-custom {
display: none;
}
.radio-custom + label {
position: relative;
padding-left: 25px;
cursor: pointer;
}
.radio-custom + label:before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 20px;
height: 20px;
background-color: #f0f0f0;
border-radius: 50%;
}
.radio-custom:checked + label:before {
background-color: #007bff;
}