![]() |
VOOZH | about |
The checked selector is used to select all checked elements in the input tag and radio buttons. This selector is used with radio buttons, checkbox and option elements.
Syntax:
:checked {
// CSS property
}
Example 1: In this example, The CSS :checked selector targets checked input elements. It sets a height and width for checked checkboxes and applies a green color to the h1 element.
Output:👁 Image
Example 2: In this example, The CSS option:checked selector targets the selected option within a <select> element. It sets a height of 10px and a font size of 20px for the selected option.
Output:👁 Image
Supported Browsers: The browser supported by :checked Selector are listed below: