Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Pseudo-classes

The :indeterminate pseudo-class

Reference for the CSS :indeterminate pseudo-class: style mixed-state checkboxes, unselected radio groups and indeterminate progress bars, with examples.

The :indeterminate pseudo-class matches form controls whose state is neither on nor off. Three cases qualify: a checkbox whose indeterminate DOM property is true, a radio button whose whole group has nothing selected, and a <progress> element with no value attribute.

The classic use is a "select all" checkbox that shows a dash when only some of its children are ticked. There is no HTML attribute for that state; scripts set it.

CSS
input[type="checkbox"]:indeterminate {
  accent-color: #d97706;
}

Try it

Select all with a mixed state

Syntax

CSS
:indeterminate { /* declarations */ }
  • Applies to: checkboxes, radio buttons and <progress> elements.
  • Specificity: (0,1,0), like any pseudo-class.
  • Inherited / animatable: not applicable.

Values

Syntax and arguments Description
:indeterminate No arguments. Matches a checkbox with indeterminate = true, a radio in a group with no checked member, or a <progress> without a value.

Usage notes

  • Visual only. The indeterminate property changes how the box looks. It does not change checked or what the form submits, so keep checked correct yourself.
  • Clicking clears it. When the user activates an indeterminate checkbox, the browser sets indeterminate back to false.
  • Radio groups. Every radio in a group with no selection matches, which is a handy way to flag "nothing chosen yet" (although :required:invalid often says the same thing).
  • Accessibility. Browsers expose the state as aria-checked="mixed", so assistive technology hears it. Do not rely on colour alone to tell it apart.
  • Progress bars. An indeterminate <progress> means "working, unknown duration". Style it with accent-color; the animation itself is the browser's.

Browser support

Supported in all current browsers.