Simple checkbox switch

lorainevilches

Loraine Vilches

Posted on April 18, 2022

Simple checkbox switch

If you want your switch to work, you need to transform it into a checkbox element, otherwise, you will not be able to know if it is "on" or "off".

So, there's a simple way to do it. Create an box around it and hide the checkbox, and, with a little "css-animation", done.

Here, you will only need to:

  • Put it inside a div and position then in your layout
  • Change the background-color(s)

๐Ÿ’– ๐Ÿ’ช ๐Ÿ™… ๐Ÿšฉ
lorainevilches
Loraine Vilches

Posted on April 18, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

ยฉ TheLazy.dev

About