DEV Community


Discussion on: Let's create a custom toggle switch using HTML and CSS.

shtep profile image
jim shtepa

Is there any reason not using .checkbox {display:none} instead of .checkbox {
opacity: 0;
width: 0;
height: 0;

great material and presentation. thank you!

devggaurav profile image
Gaurav Author

Hey, thank u so much for pointing that out. It's actually my fault😅 I was trying different things to hide that checkbox to see what works best (like display: none, height:0 width:0, opacity:0, etc), and by mistake, I forgot to remove the extra code when writing this article😅display: none also works!.