Skip to content

CSS Selectors

Default

About

The :default pseudo-class matches checkboxes, radio buttons, and select options that are checked/selected by default.

Checkboxes

Checkboxes that are checked by default match. Only the default state is matched. Changing the state of the checkbox manually doesn't change the match.

Radio Buttons

Radio buttons that are selected by default match. Only the default state is matched. Changing the state of the radio button manually doesn't change the match.

Select

Select options that are selected by default match. Only the default state is matched. Changing the state of the select option manually doesn't change the match. This works for single and multiple select elements, but options of a single select element cannot be styled.

Submit Buttons

The default submit button of a form also matches. Because there can only be one default submit button, the second button doesn't match.