checkbox (4.2.17)

In this example below you will see how to do a checkbox (4.2.17) with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by chelly182, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright chelly182 ©
  • HTML
  • CSS
  • JavaScript
    <div>
  <input type="checkbox"/>
  <label></label>
</div>

/*Downloaded from https://www.codeseek.co/chelly182/checkbox-4217-LWqdZX */
    div {
  border:1px solid black;
  position:relative;
}

input[type="checkbox"]{
  position: absolute;
  width:100%;
  height:100%;
  margin:0;
  opacity:0;
}

input[type="checkbox"] + label{
  width:0;
  height:2em;
  background-color:blue;
  display:block;
  transition: 1s ease;
}

input[type="checkbox"]:checked + label{
  background-color:red;
  width: 100%;
}


/*Downloaded from https://www.codeseek.co/chelly182/checkbox-4217-LWqdZX */
    

Comments