pseudo-class
:checked — CSS reference
Matches a checked checkbox or radio or selected option; current state can differ from the original checked attribute.
Formal Syntax & Structure
css syntaxcss
:checkedWorking Example
Example Snippetcss
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Selector lab</title><style>:where(.sample) { color: rgb(32, 32, 32); }input:checked { color: rgb(0, 96, 80); }</style></head><body><label>A <input id="a" class="sample" type="checkbox" checked></label><label>B <input id="b" class="sample" type="checkbox"></label></body></html>