2
I am trying to change the relative’s vertical position ". switch", but I can only do it with px and not with %. How can I solve this?
HTML
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
CSS
.switch{
position: relative;
display:inline-block;
width: 60px;
height: 34px;
left: 50%;
bottom: 150px;
}
.switch input{
opacity: 0;
width: 0;
height: 0;
}
.slider{
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
Got it! Thank you very much!
– alexrr10
@alexrr10 cool my dear, I’m glad to have helped!
– hugocsl