Which CSS pseudo-class selects a checkbox that is neither checked nor unchecked?

The story behind the answer

The CSS pseudo-class that selects a checkbox in neither a checked nor unchecked state is `:indeterminate`.

A checkbox becomes indeterminate when its JavaScript `indeterminate` property is set to `true`. This creates a visual and logical third state, often shown with a dash, and is useful for “select all” controls when only some child items are selected. The state is separate from the checkbox’s submitted value and is not created merely by adding an HTML attribute.

The same pseudo-class can match radio buttons when every radio button in a same-named group is unchecked. It can also match a `<progress>` element that has no value. These additional cases are why `:indeterminate` is broader than a checkbox-only feature.

A common mix-up is `:default`, which identifies controls selected by default when the page loads. `:checked` matches the checked state, while `:indeterminate` represents uncertainty or partial selection. JavaScript normally sets or clears the checkbox state because HTML has no standard `indeterminate` attribute.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: