Menu

Tech tip - Unusual CSS switch

I found a pure-CSS switch that does not use the 'for' attribute of the label to set the 'input' element.

This switch has the 'input' element as the background for the whole switch and uses 'pointer-events: none' on the label to pass clicks through to the 'input' element.

This switch is at:

https://codepen.io/nikkk-me/pen/abvPjeG

There are more tips at: bbingo.xyz/t

Posted by Bert Beckwith 2023-08-06 Labels: CSS HTML

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.