The :indeterminate pseudo-class styles checkboxes and other controls in a partial or unknown state — neither fully checked nor unchecked.
01
Third state
Partial check.
02
Select All
Parent checkbox.
03
JavaScript
Set via JS.
04
:checked
Not the same.
05
progress
Unknown load.
06
accent-color
Easy styling.
Fundamentals
Introduction
The :indeterminate selector in CSS targets checkboxes or radio buttons that are in an indeterminate state. This typically occurs when a checkbox’s selection is unclear, such as when it is partially checked.
It is commonly used in “Select All” patterns where some child options are checked but not all of them, giving users a clear visual cue for partial selection.
Definition and Usage
Use :indeterminate on its own or with an element selector: input[type="checkbox"]:indeterminate. The state must be set in JavaScript — there is no HTML attribute for indeterminate.
💡
Beginner Tip
Set the state with checkbox.indeterminate = true in JavaScript, then style it with CSS. An indeterminate checkbox is not:checked — it is a separate third state.
Foundation
📝 Syntax
The syntax for the :indeterminate pseudo-class is:
syntax.css
:indeterminate{/* CSS properties */}
The :indeterminate pseudo-class applies to <input type="checkbox">, <input type="radio">, and <progress> elements in an indeterminate state.
input:indeterminate + label targets the label immediately following an indeterminate checkbox, adding an amber highlight to draw attention to the partial state.
Example 4 — Indeterminate progress bar
A <progress> element without a value is natively indeterminate — useful for unknown loading duration.
<progress> without a value attribute matches :indeterminate and shows an animated loading bar in supporting browsers.
Tips
💬 Usage Tips
JavaScript required — Set checkbox.indeterminate = true; there is no HTML attribute.
Pair with :checked — Style all three states: default (unchecked), :checked, and :indeterminate.
Select All logic — Set indeterminate when some children are checked; clear it when all or none are checked.
accent-color — The simplest cross-browser approach for native checkbox tinting.
progress element — Use <progress> without value for unknown-duration loading.
Watch Out
⚠️ Common Pitfalls
No HTML indeterminate attribute — The old indeterminate HTML attribute does not exist; use JavaScript only.
Not the same as :checked — Indeterminate checkboxes do not match :checked; style both separately.
:unchecked is non-standard — Avoid relying on :unchecked; use the default style for unchecked boxes instead.
Clicking clears indeterminate — User interaction typically resets indeterminate to checked or unchecked.
Browser rendering differences — The dash icon and accent-color support vary; test in major browsers.
A11y
♿ Accessibility
aria-checked="mixed" — Mirror the indeterminate visual state for screen readers with this ARIA attribute.
Label every checkbox — Use <label for="..."> so assistive tech announces the control name.
Do not rely on color alone — The browser’s dash icon plus label text should convey partial selection.
Keyboard support — Indeterminate checkboxes remain focusable and operable via Space key.
State announcements — Consider live regions or ARIA updates when toggling between all, none, and mixed states.
🧠 How :indeterminate Works
1
JavaScript sets state
checkbox.indeterminate = true puts the control in a partial state.
JS
2
:indeterminate matches
The browser marks the element as indeterminate — not checked, not unchecked.
Match
3
CSS styles apply
Accent color, labels, or custom rules highlight the partial state.
Style
=
☐
Clear partial selection
Users see that some — but not all — options are selected.
Compatibility
🖥 Browser Compatibility
The :indeterminate pseudo-class is supported in all modern browsers.
✓ Baseline · Modern browsers
Indeterminate styling everywhere
:indeterminate works in Chrome, Firefox, Safari, and Edge for checkboxes and progress elements.
97%Global support
Google Chrome20+ · Desktop & Mobile
Full support
Mozilla Firefox4+ · Desktop & Mobile
Full support
Apple Safari5.1+ · macOS & iOS
Full support
Microsoft Edge12+
Full support
Opera11+
Full support
:indeterminate pseudo-class97% supported
Bottom line: Safe for modern Select All and progress bar UIs. Test checkbox appearance across browsers.
Wrap Up
🎉 Conclusion
The :indeterminate selector lets you style form elements in an ambiguous partial state, making “Select All” and mixed-selection UIs more intuitive.
Combine JavaScript to set the state, CSS to style it, and aria-checked="mixed" for accessibility. Pair with :checked for a complete three-state checkbox experience.
Style :indeterminate, :checked, and default states
Use for Select All parent checkboxes
Add aria-checked="mixed" for screen readers
Clear indeterminate when all/none are selected
❌ Don’t
Expect an HTML indeterminate attribute
Treat indeterminate as :checked
Rely on the non-standard :unchecked pseudo-class
Depend on color alone for partial state
Forget to update state when children change
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about :indeterminate
Use these points when styling partial checkbox states.
5
Core concepts
☐01
Third state
Partial check.
Purpose
JS02
.indeterminate
Set via script.
HTML
☑03
Not :checked
Separate state.
Rule
All04
Select All
Top use case.
Pattern
🌐05
97% support
All browsers.
Compat
❓ Frequently Asked Questions
The :indeterminate pseudo-class matches form controls in an indeterminate state — neither fully checked nor unchecked. It is commonly used for a "Select All" checkbox when only some child options are selected.
No. There is no HTML attribute for indeterminate. You must set it with JavaScript: checkbox.indeterminate = true. The visual dash or partial state is then styleable with :indeterminate.
No. An indeterminate checkbox is not :checked. It is a third state between checked and unchecked, used to represent partial selection.
Primarily input[type="checkbox"] and input[type="radio"]. The progress element also matches :indeterminate when it has no value (unknown progress).
:indeterminate is supported in all modern browsers including Chrome, Firefox, Safari, and Edge. Always test checkbox appearance across browsers.