CSS3 :checkedSelectors

Complete CSS Selector Reference Manual

Example

Set the height and width for all selected input elements:

input:checked { height: 50px; width: 50px; }

Try it Yourself »

Definition and Usage

The :checked selector matches every selected input element (only applies to radio buttons or checkboxes).

:checked is a pseudo-class selector in CSS3, used to select checkboxes or radio buttons that are checked within form elements. When a user clicks a checkbox or radio button and it becomes checked, the :checked selector takes effect. This allows you to modify element styles or perform other operations when a user selects an option.

For example, you can use the :checked selector to change the style of selected checkboxes or radio buttons, or to link them with other elements. This is very useful for creating interactive forms or customizing the appearance of checkboxes and radio buttons.


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Selectors
:checked 4.0 9.0 3.5 3.2 9.6

Complete CSS Selector Reference Manual

other extensions