I possess these items.
https://i.sstatic.net/zxK1r.png
https://i.sstatic.net/uSqL3.png
I desire this.
https://i.sstatic.net/23qD3.png
https://i.sstatic.net/46w5B.png
The following code may seem daunting, but here it is:
html:
<!DOCTYPE html>
<html>
<head>
<title>check</title>
<link rel="stylesheet" type="text/css" href="main2.css">
</head>
<body>
<label class="switch">
<input type="checkbox">
<div class="slider"></div>
</label>
</body>
</html>
The CSS code goes like this:
.switch {
position: relative;
display: inline-block;
width: 180px;
height: 34px;
}
/* Hide default HTML checkbox */ .switch input {display:none;}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: red;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 36px;
width: 60px;
left:0px;
bottom: -1px;
top: -1px;
background-color: black;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(120px);
-ms-transform: translateX(120px);
transform: translateX(120px);
}
I understand that this code snippet appears lengthy, but it is quite easy to grasp. Thank you for your assistance.