<div class="custom_radio">
<input type="radio" id="featured-1" name="featured" checked><label for="featured-1">Custom Radio Button 1</label>
<br>
<input type="radio" id="featured-2" name="featured"><label for="featured-2">Custom Radio Button 2</label>
<br>
<input type="radio" id="featured-3" name="featured"><label for="featured-3">Custom Radio Button 3</label>
</div>
body{
align-items: center;
background-color:#CDDC39;
color:#827717;
display: flex;
font-family: 'Roboto', sans-serif;
font-size: 32px;
line-height: 1.5em;
height: 100vh;
margin: 0;
justify-content: center;
}
.custom_radio{
margin: 20px;
}
.custom_radio input[type="radio"]{
display: none;
}
.custom_radio input[type="radio"] + label{
position: relative;
display: inline-block;
padding-left: 1.5em;
margin-right: 2em;
cursor: pointer;
line-height: 1em;
transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.custom_radio input[type="radio"] + label:before,
.custom_radio input[type="radio"] + label:after{
content: '';
position: absolute;
top: 0;
left: 0;
width: 1em;
height: 1em;
text-align: center;
color: white;
font-family: Times;
border-radius: 50%;
transition: all .3s ease;
transition: all .3s ease;
}
.custom_radio input[type="radio"] + label:before {
transition: all .3s ease;
transition: all .3s ease;
box-shadow: inset 0 0 0 0.2em white, inset 0 0 0 1em white;
}
.custom_radio input[type="radio"] + label:hover:before {
transition: all .3s ease;
transition: all .3s ease;
box-shadow: inset 0 0 0 0.3em white, inset 0 0 0 1em #c6c6c6;
}
.custom_radio input[type="radio"]:checked + label:before {
transition: all .3s ease;
transition: all .3s ease;
box-shadow: inset 0 0 0 0.2em white, inset 0 0 0 1em #4CAF50;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.