You don’t need JavaScript

css-custom-checkboxes

CSS is powerful, you can do a lot of things without JavaScript.

A quite commonly known example is usage of the Adjacent Sibling Selector (viz. +) to build custom radio buttons/checkboxes or tab interfaces.

See the Pen CSS Custom Checkboxes / Radio Buttons by Bramus! (@bramus) on CodePen.

With a few more CSS tricks such as the :target/…/:active/:checked pseudo-classes, the ::after/::before pseudo-elements, and the attr() CSS function one can achieve some other great effects:

You don’t need JavaScript is a repo that aggregates many of these “Pure CSS” Solutions.

You don’t need JavaScript →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Join the Conversation

2 Comments

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.