:checked

noun

say it: “KOH-lun CHEKT” /ˈkoʊlən tʃɛkt/

A pseudo-class that matches a checkbox or radio button that is ticked, and the chosen option in a drop-down list.

What does :checked do?

:checked styles checkboxes, radio buttons and options that are selected.

input[type="checkbox"]:checked + label { text-decoration: line-through; }   /* a done to-do item */

In a sentence

  • “Styling the Like box with :checked turned its heart red as soon as someone ticked it.”

Level: Apprentice · More CSS terms at this level

Updated