This pseudo-class is called selected-option and will match any element which is in checked mode when the user selects the element(s), e.g. checkboxes or radio buttons.
# Syntax
Copy
:checked {
/* declarations */
}
# Example
Copy
:checked {
opacity: 0.5;
}
Here, in this example, will change the opacity
of a checked checkbox to the value of 50%.
# Browser support
Platform
Chrome
Firefox
Safari
Edge
Internet Explorer
Opera
Desktop
Yes (1)
Yes (1)
Yes (3)
Yes (12)
Yes (9)
Yes (9)
Please wait a moment, the comments start loading now...