Created
October 7, 2019 06:10
-
-
Save shubh007-dev/2420b83870d31bc021701f0bf76a4f90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The container */ | |
.radioContainer { | |
display: block; | |
position: relative; | |
padding-left: 35px; | |
margin-bottom: 12px; | |
cursor: pointer; | |
font-size: 22px; | |
-webkit-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
} | |
/* Hide the browser's default radio button */ | |
.radioContainer input { | |
position: absolute; | |
opacity: 0; | |
cursor: pointer; | |
} | |
/* Create a custom radio button */ | |
.checkmark { | |
position: absolute; | |
top: 0; | |
left: 0; | |
height: 20px; | |
width: 20px; | |
background-color: #FFFFFF; | |
border-radius: 50%; | |
border: 2px solid #6E6E6E; | |
} | |
/* On mouse-over, add a red border */ | |
.radioContainer:hover input ~ .checkmark { | |
border: 2px solid #B52026; | |
} | |
/* When the radio button is checked, add a red background */ | |
.radioContainer input:checked ~ .checkmark { | |
background-color: #B52026; | |
border: 2px solid #B52026; | |
} | |
/* Create the indicator (the dot/circle - hidden when not checked) */ | |
.checkmark:after { | |
content: ""; | |
position: absolute; | |
display: none; | |
} | |
/* Show the indicator (dot/circle) when checked */ | |
.radioContainer input:checked ~ .checkmark:after { | |
display: block; | |
} | |
/* Style the indicator (dot/circle) */ | |
.radioContainer .checkmark:after { | |
top: 4px; | |
left: 4px; | |
width: 8px; | |
height: 8px; | |
border-radius: 50%; | |
background: white; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment