Interactive online courses HTML Academy
2026-03-09 14:10 Diff

So, we have finished creating the skeleton code for our buttons. Let’s now bring them to life.

We can toggle the buttons using a technique involving the ~ and :checked selectors

First, assign a background color for the active state of the buttons. The “True” button changes the color to green, and the “False” button changes it to red. To do this, we will need to use the following selectors:

.paper-btn-true input:checked ~ label { ... } // True .paper-btn-false input:checked ~ label { ... } // False