<!DOCTYPE html>
<html>
<head>
<style>
.main {
display: block;
position: relative;
padding-left: 45px;
margin-bottom: 15px;
cursor: pointer;
font-size: 20px;
}
h1 {
color: orange;
}
/* Hiding the initial checkbox */
input[type="checkbox"] {
visibility: hidden;
}
/* Creating a custom checkbox based on demand */
.w3docs {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: black;
}
/* Specify the background color to be shown when hovering over checkbox */
.main:hover input ~ .w3docs {
background-color: gray;
}
/* Specify the background color to be shown when checkbox is active */
.main input:active ~ .w3docs {
background-color: white;
}