Imagine a checkbox with this id
<input type="checkbox" id="
this
">
Imagine a label, with the same specific ID ( this ) in for attribute
<label for="
this
"> A label </label>
When you click in a label, the checkbox with same ID ( this ) becomes "checked". Using :checked and CSS advanced selectors (~, +), you can style the element. Try:
#this:checked ~ div {
new background color
}
And finally, it's only important that the checkbox is hidden. Label works "alone"! Result:
That's all! Use your creativity :-)