::before
was used along with the checkbox, in which the content
property was added.
Follow the code below:
body {
margin: 5px;
padding: 0;
background: #262626;
}
#botoes {
position: absolute;
width: 100px;
color: #fff;
margin: 5px;
}
#botoes input[type=checkbox]::before {
content: '';
position: absolute;
width: 40px;
height: 40px;
top: 0;
left: 0;
border-radius: 50%;
background: #000;
transition: .1s;
transform: scale(1.1);
box-shadow: 0 0px 15px #ffffff;
}
#botoes input[type=checkbox] {
position: relative;
background: #b9b9c8;
width: 80px;
height: 40px;
border: none;
float: right;
border-radius: 20px;
-webkit-appearance: none;
margin-bottom: 15%;
outline: none;
}
#botoes input:checked[type=checkbox]::before {
left: 40px;
}
#botoes input:checked[type=checkbox] {
background: dodgerBlue;
}
<html lang="pt-br">
<head>
<title>Test Toogle With Pure CSS</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="CSS/xxxxxxxx.css">
</head>
<div class="box" id="box">
</div>
<body>
<div id="botoes">
Hidden Rings
<input type="checkbox"> Collision Rings
<input type="checkbox">
</div>
</body>
</html>