"toggle radio btn"
Bootstrap 4.1.1 Snippet by banwarilalpurvya

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="outerDivFull" > <div class="switchToggle"> <input type="checkbox" id="switch"> <label for="switch">Toggle</label> </div> <div class="switchToggle"> <input type="checkbox" id="switch1"> <label for="switch1">Toggle</label> </div> </div>
.outerDivFull { margin:50px; } .switchToggle input[type=checkbox]{height: 0; width: 0; visibility: hidden; position: absolute; } .switchToggle label {cursor: pointer; text-indent: -9999px; width: 70px; max-width: 70px; height: 30px; background: #d1d1d1; display: block; border-radius: 100px; position: relative; } .switchToggle label:after {content: ''; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; background: #fff; border-radius: 90px; transition: 0.3s; } .switchToggle input:checked + label, .switchToggle input:checked + input + label {background: #3e98d3; } .switchToggle input + label:before, .switchToggle input + input + label:before {content: 'No'; position: absolute; top: 5px; left: 35px; width: 26px; height: 26px; border-radius: 90px; transition: 0.3s; text-indent: 0; color: #fff; } .switchToggle input:checked + label:before, .switchToggle input:checked + input + label:before {content: 'Yes'; position: absolute; top: 5px; left: 10px; width: 26px; height: 26px; border-radius: 90px; transition: 0.3s; text-indent: 0; color: #fff; } .switchToggle input:checked + label:after, .switchToggle input:checked + input + label:after {left: calc(100% - 2px); transform: translateX(-100%); } .switchToggle label:active:after {width: 60px; } .toggle-switchArea { margin: 10px 0 10px 0; }

Related: See More


Questions / Comments:

PERFECTO!

carlosavb7 () - 3 years ago - Reply 0