Toggle on/off either to off/on another - html

I have two toggle buttons, I want both buttons to work in opposite for each other in such a way:
When I toggle on/green First Toggle, Second Toggle should be turned off and vice versa (when Second Toggle is on/green, First Toggle should be off/red)
div.switcher label {
padding: 0;
}
div.switcher label input {
display: none;
}
div.switcher label * {
vertical-align: middle;
}
input:checked {
background-color: #46c146;
gap: 10px;
border: 4px solid red;
}
input[type=checkbox], input[type=radio] {
cursor: pointer !important;
width: 38px;
height: 38px;
background-color: green;
border-radius: 54%;
vertical-align: middle;
border: 3px double red;
appearance: none;
-webkit-appearance: none;
outline: none;
cursor: pointer;
}
div.switcher label input:checked+span {
background: green;
border-color: green;
}
div.switcher label input+span {
position: relative;
display: inline-block;
margin-right: 10px;
width: 50px;
height: 26px;
background: red;
border: 2px solid red;
border-radius: 50px;
transition: all 0.3s ease-in-out;
cursor: pointer;
}
div.switcher label input:checked+span small {
left: 50%;
}
div.switcher label input+span small {
position: absolute;
display: block;
width: 50%;
height: 100%;
background: #fff;
border-radius: 50%;
transition: all 0.3s ease-in-out;
left: 0;
}
<label>First Toggle</label>
<div class="switcher">
<label for="toggle-1">
<input id="toggle-1" class="my_features" type="checkbox">
<span>
<small></small>
</span>
<small></small>
</label>
</div>
<label>Second Toggle</label>
<div class="switcher">
<label for="toggle-2">
<input id="toggle-2" class="my_features" type="checkbox">
<span>
<small></small>
</span>
<small></small>
</label>
</div>

Using JQuery, here is the function when either is on another will be off.
var allIds = [ "toggle-1", "toggle-2" ];
function uncheck( event )
{
var id = event.target.id;
allIds.forEach( function( id ){
if ( id != event.target.id )
{
document.getElementById( id ).checked = false;
}
});
}
jQuery("#toggle-1").click(uncheck);
jQuery("#toggle-2").click(uncheck);
div.switcher label {
padding: 0;
}
div.switcher label input {
display: none;
}
div.switcher label * {
vertical-align: middle;
}
input:checked {
background-color: #46c146;
gap: 10px;
border: 4px solid red;
}
input[type=checkbox], input[type=radio] {
cursor: pointer !important;
width: 38px;
height: 38px;
background-color: green;
border-radius: 54%;
vertical-align: middle;
border: 3px double red;
appearance: none;
-webkit-appearance: none;
outline: none;
cursor: pointer;
}
div.switcher label input:checked+span {
background: green;
border-color: green;
}
div.switcher label input+span {
position: relative;
display: inline-block;
margin-right: 10px;
width: 50px;
height: 26px;
background: red;
border: 2px solid red;
border-radius: 50px;
transition: all 0.3s ease-in-out;
cursor: pointer;
}
div.switcher label input:checked+span small {
left: 50%;
}
div.switcher label input+span small {
position: absolute;
display: block;
width: 50%;
height: 100%;
background: #fff;
border-radius: 50%;
transition: all 0.3s ease-in-out;
left: 0;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<label>First Toggle</label>
<div class="switcher">
<label for="toggle-1">
<input id="toggle-1" class="my_features" type="checkbox">
<span>
<small></small>
</span>
<small></small>
</label>
</div>
<label>Second Toggle</label>
<div class="switcher">
<label for="toggle-2">
<input id="toggle-2" class="my_features" type="checkbox">
<span>
<small></small>
</span>
<small></small>
</label>
</div>

Related

Content Moves on Opening Select Dropdown

I need help with the Select Dropdown. It moves the content (Hello World) when opened. I have used Radio Input to select the specfic option when performing a Search. If there is any other better solution for this type of functionality, please assist.
HTML
<span class="dropdown-el">
<input type="radio" name="sortType" value="Relevance" checked="checked" id="sort-relevance"><label for="sort-relevance">Relevance</label>
<input type="radio" name="sortType" value="Popularity" id="sort-best"><label for="sort-best">Product Popularity</label>
<input type="radio" name="sortType" value="PriceIncreasing" id="sort-low"><label for="sort-low">Price Low to High</label>
<input type="radio" name="sortType" value="PriceDecreasing" id="sort-high"><label for="sort-high">Price High to Low</label>
<input type="radio" name="sortType" value="ProductBrand" id="sort-brand"><label for="sort-brand">Product Brand</label>
<input type="radio" name="sortType" value="ProductName" id="sort-name"><label for="sort-name">Product Name</label>
</span>
<h1> Hello World</h1>
CSS
body {
text-align: center;
background: #ebf4fb;
min-height: 95vh;
margin: 0;
padding: 0;
border-bottom: 5vh solid #3694d7;
font-family: "Myriad Pro", "Arial", sans;
font-size: 24px;
}
.dropdown-el {
margin-top: 20vh;
min-width: 12em;
position: relative;
display: inline-block;
margin-right: 1em;
min-height: 2em;
max-height: 2em;
overflow: hidden;
top: 0.5em;
cursor: pointer;
text-align: left;
white-space: nowrap;
color: #444;
outline: none;
border: 0.06em solid transparent;
border-radius: 1em;
background-color: #cde4f5;
transition: 0.3s all ease-in-out;
}
.dropdown-el input:focus + label {
background: #def;
}
.dropdown-el input {
width: 1px;
height: 1px;
display: inline-block;
position: absolute;
opacity: 0.01;
}
.dropdown-el label {
border-top: 0.06em solid #d9d9d9;
display: block;
height: 2em;
line-height: 2em;
padding-left: 1em;
padding-right: 3em;
cursor: pointer;
position: relative;
transition: 0.3s color ease-in-out;
}
.dropdown-el label:nth-child(2) {
margin-top: 2em;
border-top: 0.06em solid #d9d9d9;
}
.dropdown-el input:checked + label {
display: block;
border-top: none;
position: absolute;
top: 0;
width: 100%;
}
.dropdown-el input:checked + label:nth-child(2) {
margin-top: 0;
position: relative;
}
.dropdown-el::after {
content: "";
position: absolute;
right: 0.8em;
top: 0.9em;
border: 0.3em solid #3694d7;
border-color: #3694d7 transparent transparent transparent;
transition: 0.4s all ease-in-out;
}
.dropdown-el.expanded {
border: 0.06em solid #3694d7;
background: #fff;
border-radius: 0.25em;
padding: 0;
box-shadow: rgba(0, 0, 0, 0.1) 3px 3px 5px 0px;
max-height: 15em;
}
.dropdown-el.expanded label {
border-top: 0.06em solid #d9d9d9;
}
.dropdown-el.expanded label:hover {
color: #3694d7;
}
.dropdown-el.expanded input:checked + label {
color: #3694d7;
}
.dropdown-el.expanded::after {
transform: rotate(-180deg);
top: 0.55em;
}
JQuery
$('.dropdown-el').click(function(e) {
e.preventDefault();
e.stopPropagation();
$(this).toggleClass('expanded');
$('#'+$(e.target).attr('for')).prop('checked',true);
});
$(document).click(function() {
$('.dropdown-el').removeClass('expanded');
});
https://codepen.io/libsys/pen/bGKomaE
Please assist.

In Dual Slider HTML component, click inside first element is not recognized in Internet Explorer

I am trying to build a Dual Step Slider using HTML and CSS alone without any JQuery. It is working fine in Chrome and Mozilla, But in IE11, it is not registering the click inside first input element.
I designed the slider by using position:absolute and made two html input sliders on top of each other. In IE, i could click and drag on Second Input Elemenr only.
.slider {
-webkit-appearance: none;
width: 100%;
//height: 10px;
position: absolute;
//background: #f3f3f3;
outline: none;
border-radius: 8px;
}
.slider input {
pointer-events: none;
position: absolute;
overflow: hidden;
left: 25%;
top: 15px;
width: 50%;
outline: none;
height: 18px;
margin: 0;
padding: 0;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 8px;
background: #E6E6E6;
border: none;
border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
//border: none;
height: 20px;
width: 20px;
border-radius: 50%;
background: white;
border: 1px solid #3972D6;
margin-top: -4px;
cursor: pointer;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: #e6e6e6;
border: 2px solid #cdcdcd;
pointer-events: all;
position: relative;
z-index: 1;
outline: 0;
}
.slider::-moz-range-thumb {
width: 20px;
height: 20px;
background: #ea4550;
pointer-events: all;
position: relative;
z-index: 10;
-moz-appearance: none;
}
.slider input::-moz-range-track {
position: relative;
z-index: -1;
border: 0;
}
.slider input:last-of-type::-moz-range-track {
-moz-appearance: none;
background: none transparent;
border: 0;
}
.slider input[type="range"]::-moz-focus-outer {
border: 0;
}
.flex-next {
display: flex;
justify-content: flex-start;
}
.dual-slider-container {
position: relative;
width: 100%;
}
.dual-slider-text-left {
position: relative;
bottom: 12px;
right: 8px;
.text-style {
color: #303030;
font-size: 20px;
font-weight: 600;
text-align: right;
}
.text2 {
text-align: right;
font-size: 14px;
}
}
.dual-slider-text-right {
position: relative;
bottom: 12px;
left: 8px;
.text-style {
color: #303030;
font-size: 20px;
font-weight: 600;
text-align: left;
}
.text2 {
text-align: left;
font-size: 14px;
}
}
.pointer {
cursor: pointer;
}
//Internet Explorer Support
input[type=range]::-ms-track {
width: 100%;
height: 8px;
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
background: transparent;
/*leave room for the larger thumb to overflow with a transparent border */
border-color: transparent;
border-width: 6px 0;
/*remove default tick marks*/
color: transparent;
}
#lower::-ms-fill-lower {
background: #E6E6E6;
border-radius: 10px;
}
#lower::-ms-fill-upper {
background: #E6E6E6;
border-radius: 10px;
}
#higher::-ms-fill-lower {
background: transparent;
border-radius: 10px;
}
#higher::-ms-fill-upper {
background: transparent;
border-radius: 10px;
}
input[type=range]::-ms-thumb {
//border: none;
height: 18px;
width: 18px;
border-radius: 50%;
background: white;
border: 1px solid #3972D6;
//cursor: hand;
}
input[type=range]::-ms-tooltip {
display: none;
}
<div style="padding:8px" class="col-12 row m-0">
<div class="dual-slider-text-left col-2 p-0">
<div class="text-style">
{{minValue}}
</div>
<div class="text2">{{minValueText}}</div>
</div>
<div class="col-8 p-0">
<div class="dual-slider-container">
<input (click)="getSliderOneValue($event)" type="range" min="{{minValue}}" max="{{maxValue}}" step="1"
value="{{sliderOneValue}}"
class="slider" [disabled]="disabled" [ngClass]="{'pointer' : !disabled}"
id="lower">
</div>
<div class="dual-slider-container">
<input (click)="getSliderTwoValue($event)" type="range" min="{{minValue}}" max="{{maxValue}}" step="1"
value="{{sliderTwoValue}}"
class="slider" [disabled]="disabled" [ngClass]="{'pointer' : !disabled}"
id="higher">
</div>
</div>
<div class="dual-slider-text-right col-2 p-0">
<div class="text-style">{{maxValue}}</div>
<div class="text2">{{maxValueText}}</div>
</div>
</div>
It seems that you can only reach the second slider if they're lapped in IE. You could use two slides side by side as a workaround. I make a demo and you could refer to it.
body {
min-height: 100px;
}
div {
display: flex;
}
input {
flex: 1 0 0;
min-width: 0;
padding: 0;
}
input::-webkit-slider-thumb {
margin: 0;
padding: 0;
}
output {
display: block;
text-align: center;
margin-top: 3px;
color: gray;
}
<div>
<input id="a" type="range" min="0" max="10" value="0" />
<input id="b" type="range" min="11" max="20" value="20" />
</div>
<output></output>

Transition Origins

I am currently making a pretty simplistic login page. I would like that the transition between .form input[type="text"]:focus, .form input[type="password], instead of gradually fading the color in, it swooshes the new color from left to right.
Here is my code:
.form input[type="text"],
.form input[type="password"] {
margin-top: 0;
margin-bottom: 5px;
border: none;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: black;
background: transparent;
outline: none;
height: 2.5vh;
color: black;
border-radius: 0;
font-size: 100%;
transition-property: border-bottom-color;
transition-duration: 350ms;
transition-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1);
}
.form input[type="text"]:focus,
.form input[type="password"]:focus {
border-bottom-color: #66bb6a;
}
<form class="form">
<input type="text" name="" placeholder="example#example.com">
</form>
Here is a JS Fiddle: https://jsfiddle.net/juja15ro/
I was able to do it but with javascript.
const inputs = document.querySelectorAll('.input-container input');
inputs.forEach((input) => {
input.addEventListener('focus', () => {
input.parentElement.classList.add('focused');
})
input.addEventListener('blur', () => {
input.parentElement.classList.remove('focused');
})
})
.input-container {
position: relative;
display: inline-block;
}
.input-container:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
height: 2px;
width: 0;
background-color: #000;
transition: .24s ease-out;
}
.input-container input {
border: none;
background: transparent;
border-bottom: 1px solid #ccc;
outline: none;
}
.input-container.focused:after {
width: 100%;
}
<div class="input-container">
<input type="text" placeholder="Name">
</div>
I have created a span(input bar) and added :before and :after property to it and for the left to right movement, before should be 0% and after should be 100% .(Also try before to 50% and after to 50% and see movement effect starting from center) Here's my code
*:focus {
outline: none;
}
input {
display: block;
border: none;
border-bottom: 1px solid #000;
font-family: Trebuchet MS;
background: none;
}
.inputBar {
position: relative;
display: block;
width: 290px;
}
.inputBar:before,
.inputBar:after {
content: "";
display: block;
position: absolute;
bottom: 0;
width: 0;
background: #66bb6a;
height: 2px;
transition: all 0.2s ease;
}
.inputBar:after {
right: 100%;
}
.inputBar:before {
left: 0%;
}
input:focus~.inputBar:before,
input:focus~.inputBar:after {
width: 50%;
}
<form class="form">
<input type="text" name="" placeholder="example#example.com">
<span class="inputBar"></span>
</form>

Custom checkboxes move slightly when selected

I modified the checkboxes in my project to look more aligned with the rest of the design but I have a problem: whenever selected the label of the checkbox moves slightly.
input[type="checkbox"] {
display: none !important;
}
input[type="checkbox"]+label:before {
position: relative;
content: " ";
display: inline-block;
width: 22px;
height: 22px;
border: 1px solid grey;
top: 4px;
margin: 0 10px 0 0;
}
input[type="checkbox"]:checked+label:before {
position: relative;
content: "✔";
display: inline-block;
width: 22px;
height: 22px;
border: 1px solid grey;
top: 4px;
margin: 0 10px 0 0;
}
<input type="checkbox" />
<label>Click to accept</label>
Here's the result:
And here's what happens if I select it:
What am I doing wrong?
Nowadays and for awhile you can fix this if you set the parent to display:flex
input[type="checkbox"] {
display: none !important;
}
label {
display: flex;
/* just to vertically the text with the box */
align-items: center
}
input[type="checkbox"]+label::before {
content: "";
display: block;
width: 22px;
height: 22px;
border: 1px solid grey;
margin: 0 10px 0 0;
}
input[type="checkbox"]:checked+label::before {
content: "✔";
/* just to center inside the box */
display: grid;
place-content: center;
}
<input id="input" type="checkbox" />
<label for="input">Click to accept</label>
OLD ANSWER
To fix the "moving" you need to:
set vertical-align: some value in label::before I have choose bottom.
And to align the "✔" (in case it doesn't - snippet isn't), you need to:
add text-align:center and line-height:22px (same as the height) in :checked+label::before
input[type="checkbox"] {
display: none !important;
}
input[type="checkbox"]+label::before {
position: relative;
content: " ";
display: inline-block;
vertical-align: bottom;
width: 22px;
height: 22px;
border: 1px solid grey;
top: 4px;
margin: 0 10px 0 0;
}
input[type="checkbox"]:checked+label::before {
content: "✔";
text-align: center;
line-height: 22px;
}
<input id="input" type="checkbox" />
<label for="input">Click to accept</label>
NB: In both answers I removed duplicated properties and you're missing the for attribute in label to match id in input, otherwise you can't click in the pseudo checkbox, only in the label
You can see another way here.
See below working example:
/*--CSS--*/
input[type="checkbox"] {
-webkit-appearance: none;
background-color: transparent;
-webkit-rtl-ordering: logical;
user-select: text;
cursor: pointer;
padding: 1px;
border-width: 0;
border-style: inset;
border-color: initial;
border-image: initial;
float: left;
margin: 0 25px 0 0;
position: relative;
}
input[type="checkbox"]:after {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
content: "";
position: absolute;
left: 0;
z-index: 1;
width: 16px;
height: 16px;
border: 1px solid #c0c0c0;
top:0;
}
input[type="checkbox"]:before {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
content: "";
position: absolute;
left: 0;
z-index: 1;
width: 16px;
height: 16px;
border: 1px solid #c0c0c0;
top:0;
opactity:0;
}
input[type="checkbox"]:checked:before {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
height: 5px;
border-color: #009688;
border-top-style: none;
border-right-style: none;
outline: none;
opacity: 1;
width: 12px;
top: 3px;
left: 3px;
}
input[type="checkbox"]:focus{outline:0;}
<!--HTML-->
<input type="checkbox" />
<label>Click to accept</label>
I have used a flexbox for the label to align the items vertically. Adding text-align:center when the checkbox is checked, ensures the marker is horizontally centered.
label {
display: flex;
align-items: center;
}
input[type="checkbox"] {
display: none;
}
input[type="checkbox"]+label:before {
content: " ";
display: inline-block;
width: 22px;
height: 22px;
border: 1px solid grey;
margin-right: 0.5em;
}
input[type="checkbox"]:checked+label:before {
content: "✔";
display: inline-block;
width: 22px;
height: 22px;
border: 1px solid grey;
margin-right: 0.5em;
text-align: center;
}
<input type="checkbox" id="accept" />
<label for="accept">Click to accept</label>
you can try this, this is working
input[type="checkbox"] {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
}
input[type="checkbox"] + label:before {
position: relative;
content: " ";
display: inline-block;
width: 22px;
height: 22px;
border: 1px solid grey;
top: 4px;
margin: -8px 10px 0 0;
vertical-align: middle;
}
input[type="checkbox"]:checked + label:before {
content: "✔";
text-align: center;
line-height: 22px;
}
<input type="checkbox"/>
<label>Click to accept</label>

Radio button inside label width issue

I have custom radio buttons and I am try to display multiple radio buttons in one line. Currently, my code works fine but my issue is that I am adding fixed width to label which in my case is width:50px;.
If my text is longer... my text overlaps the next radio button. Is there a way I can avoid having fixed widths? Function like calc() does't seem to help in my situation.
I also, tried just using min-width instead of width.
* {
box-sizing: border-box;
}
input[type="radio"] {
display: none;
cursor: pointer;
}
label {
cursor: pointer;
display: inline-block;
width: 50px;
position: relative;
}
.radio span.custom > span {
margin-left: 22px;
}
.radio .custom {
background-color: #fff;
border: 1px solid #ccc;
border-radius: 3px;
display: inline-block;
height: 20px;
left: 0;
position: absolute;
top: 0;
width: 20px;
}
.radio input:checked + .custom:after {
background-color: #0574ac;
border-radius: 100%;
border: 3px solid #fff;
content: "";
display: block;
height: 12px;
position: absolute;
top: 0;
width: 12px;
}
.radio input + .custom {
border-radius: 100%;
}
.checkbox input:checked .custom {
background-color: blue;
border-color: blue;
}
<label class="radio">
<input type="radio">
<span class="custom"><span>One</span></span>
</label>
UPDATE:
I need the text to be inside the <span class="custom"> tag. I don't have to have the inner span tag there though
JSFiddle Demo
Try using :after pseudo element to construct the rounded radio button. And the change the .custom to display: inline so that it takes up the content width. Also add white-space: nowrap to the span in-order for it take the full width of text without breaking.
* {
box-sizing: border-box;
}
input[type="radio"] {
display: none;
cursor: pointer;
}
label {
cursor: pointer;
min-width: 50px;
display:inline-block;
position:relative;
}
.radio span.custom > span {
margin-left: 24px;
margin-right: 10px;
display: inline-block;
white-space: nowrap;
line-height: 22px;
}
.radio .custom {
display: inline;
}
.radio .custom:after{
content: '';
height: 20px;
left: 0;
top: 0;
width: 20px;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 3px;
position: absolute;
}
.radio input:checked + .custom:before {
background-color: #0574ac;
border-radius: 100%;
border: 3px solid #fff;
content: "";
display: block;
height: 12px;
position: absolute;
top: 2px;
width: 12px;
z-index: 1;
left: 2px;
}
.radio input + .custom:after {
border-radius: 100%;
}
.checkbox input:checked .custom {
background-color: blue;
border-color: blue;
}
<label class="radio">
<input type="radio">
<span class="custom"><span>One</span></span>
</label>
<label class="radio">
<input type="radio">
<span class="custom"><span>Two (longer text)</span></span>
</label>
<label class="radio">
<input type="radio">
<span class="custom"><span>Three (another longer text)</span></span>
</label>
<label class="radio">
<input type="radio">
<span class="custom"><span>Four</span></span>
</label>
I think a lot of things went wrong here starting from the structure of the html. First, you've got two unnecessarily nested span elements where the outter span is constraining the width of the inner span.
Personally, I'd get rid of the inner span element to make your life easier with simpler css. Then, i'd get rid of all those absolute and relative positioning that aren't needed
See example below
* {
box-sizing: border-box;
}
input[type="radio"] {
display: none;
cursor: pointer;
}
label {
cursor: pointer;
display: inline-block;
}
.radio span.custom > span {
margin-left: 22px;
}
.radio .custom {
background-color: #fff;
border: 1px solid #ccc;
border-radius: 3px;
display: inline-block;
height: 18px;
left: 0;
top: 0;
width: 18px;
vertical-align: middle;
padding: 2px;
}
.radio input:checked + .custom:after {
background-color: #0574ac;
border-radius: 100%;
content: "";
display: block;
height: 12px;
width: 12px;
}
.radio input + .custom {
border-radius: 100%;
}
.checkbox input:checked .custom {
background-color: blue;
border-color: blue;
}
<label class="radio">
<input type="radio">
<span class="custom"></span>
A veeeeeeeeeeeeeeeeeeeeeeery loooooooooooooong text for this button
</label>
<label class="radio">
<input type="radio">
<span class="custom"></span>
Two
</label>
I did made a few adjustments
I rearranged your code. Is this how you want?
JSFiddle : https://jsfiddle.net/fz5vhwtx/5/
I remove all the position absolute because it's width is not counted in the label. It's floating and I changed it to flex layout. Try to see it.
HTML
<div class="radio-holder">
<label class="radio">
<input type="radio" name="radio">
<span class="custom"></span>
<p>One</p>
</label>
<label class="radio">
<input type="radio" name="radio">
<span class="custom"></span>
<p>Two</p>
</label>
<label class="radio">
<input type="radio" name="radio">
<span class="custom"></span>
<p>One Hundred</p>
</label>
</div>
CSS
* {
box-sizing: border-box;
}
input[type="radio"] {
display: none;
cursor: pointer;
}
.radio-holder {
display: flex;
}
label {
cursor: pointer;
display: flex;
align-items: center;
position:relative;
margin-right: 20px;
}
.radio .custom {
background-color: #fff;
border: 1px solid #ccc;
border-radius: 3px;
display: inline-block;
height: 20px;
width: 20px;
margin-right: 3px;
}
.radio input:checked + .custom:after {
background-color: #0574ac;
border-radius: 100%;
border: 3px solid #fff;
content: "";
display: block;
height: 12px;
top: 0;
width: 12px;
}
.radio input + .custom {
border-radius: 100%;
}
.checkbox input:checked .custom {
background-color: blue;
border-color: blue;
}
Hope it helps you. Selamat siang.