DEV Community

Tobias Schächtelin
Tobias Schächtelin

Posted on

1 1

CSS <label> pseudo-content trick

Inspired by the Inclusive Components by Heydon Pickering and the pseudo-content trick for inclusive card components, I implemented this approach with radio buttons:

https://codepen.io/tschach/full/PowvmRK

I would be very interested in discussing whether this is a valid option and what could be improved. So if you have any feedback on the semantics, let me know!

I also tweeted about it, so feel free to leave your feedback there:

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more