Check out this code:
/* custom button */
*, *:after, *:before {
box-sizing: border-box;
}
.checkbox {
position: relative;
display: inline-block;
}
.checkbox:after, .checkbox:before {
font-family: FontAwesome;
font-feature-settings: normal;
-webkit-font-kerning: auto;
font-kerning: auto;
font-language-override: normal;
font-stretch: normal;
font-style: normal;
font-synthesis: weight style;
font-variant: normal;
font-weight: normal;
text-rendering: auto;
}
.checkbox label {
width: 90px;
position: relative;
display: inline-block;
border-radius: 46px;
transition: 0.4s;
}
.checkbox label:after {
content: '';
position: absolute;
width: 50px;
border-radius: 100%;
left: 0;
z-index: 2;
background: #fff;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
transition: 0.4s;
}
.checkbox input {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 5;
opacity: 0;
cursor: pointer;
}
.checkbox input:hover + label:after {
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.2), 0 3px 8px 0 rgba(0, 0, 0, 0.15);
}
.checkbox input:checked + label:after {
left: 40px;
}
.model-7 .checkbox label {
background: none;
border: 5px solid #555;
height: 42px; /*This line does not affect the height*/
margin-left: 15px;
}
.model-7 .checkbox label:after {
background: #555;
box-shadow: none;
top: 2px;
left: 2px;
width: 28px;
height: 28px;
}
.model-7 .checkbox input:checked + label {
border-color: #04c6db;
}
.model-7 .checkbox input:checked + label:after {
background: #04c6db;
left: 50px;
}
<div class="model-7">
<div class="checkbox">
<input type="checkbox">
<label></label>
</div>
</div>
Looking to customize the height of the toggle button? The challenge lies in finding the right element in the CSS that controls the height. Despite attempts to adjust the height property in the .checkbox label
section, the desired changes are not reflected. Any insights on how to effectively manage the height aspect of the button design?