MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

:indeterminate

This translation is incomplete. Please help translate this article from English.

Sumari

La pseudo-class CSS :indeterminate representa:

  • qualsevol element <input type="checkbox"> en que la seva propietat DOM indeterminate està establerta en true per JavaScript
  • elements <input type="radio"> en què els seus botons d'opció del grup de botons de ràdio estan desmarcats
  • elements <progress> en un estat indeterminat

Sintaxi

:indeterminate { style properties }

Exemples

Checkbox & botó radio

CSS

input, span {
  background: red;
}

:indeterminate, :indeterminate + label {
  background: lime;
}

HTML

<div>
  <input type="checkbox" id="checkbox">
  <label for="checkbox">Background should be green</label>
</div>
<div>
  <input type="radio" id="radio">
  <label for="radio">Background should be green</label>
</div>

JavaScript

var inputs = document.getElementsByTagName("input");
for(var i = 0; i < inputs.length; i++) {
  inputs[i].indeterminate = true;
}

Element Progress

CSS

:indeterminate {
  opacity: 0.5;
}

HTML

<progress>

Resultat

Especificacions

Especificació Estat Comentari
WHATWG HTML Living Standard
The definition of ':indeterminate' in that specification.
Living Standard Sense canvis
HTML5
The definition of ':indeterminate' in that specification.
Recommendation Defineix la semàntica pel que fa a la validació d'HTML i restriccions
Selectors Level 4
The definition of ':indeterminate' in that specification.
Working Draft Sense canvis
CSS Basic User Interface Module Level 3
The definition of ':indeterminate' in that specification.
Candidate Recommendation Defineix la pseudo-classe, però no la semàntica associada.

Característica Chrome Firefox (Gecko) Internet Explorer Edge Opera Safari
type="checkbox" (Yes) 3.6 (1.9.2) 9.0 (Yes) 10.60 (2.6) 3.0
<progress> 6.0 6.0 (6.0) 10 (Yes) ? 5.2
type="radio" 39.0 51 (51)[1] No support No support[2] ? No support[3]
Característica Android Firefox Mobile (Gecko) IE Mobile Edge Opera Mobile Safari Mobile
type="checkbox" ? 1.0 (1.9.2) ? ? ? ?
<progress> ? 6.0 (6.0) ? ? ? ?
type="radio" 39.0 51.0 (51.0)[1] No support No support[2] ? No support[3]

[1] Implementat en errada 885359.

[2] Veure Edge errada 7124038

[3] Veure WebKit errada 156270

Document Tags and Contributors

 Contributors to this page: Legioinvicta
 Last updated by: Legioinvicta,