We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE

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

La pseudo-class CSS :required representa qulasevol element <input>, <select> o <textarea> que té l'atribut required establert en ell.

/* Selecciona qualsevol <input> requerit */
input:required {
  border: 1px dashed red;

Aquesta pseudo-class és útil per ressaltar els camps que han de tenir dades vàlides abans de poder enviar un formulari.

Nota: La classe pseudo-class :optional selecciona camps de formulari opcionals.




Veure :invalid com exemple.


Especificació Estat Comentari
HTML Living Standard
The definition of ':required' in that specification.
Living Standard Sense canvis.
The definition of ':required' in that specification.
Recommendation Defineix la semàntica respecte a HTML i la validació de restriccions.
Selectors Level 4
The definition of ':required' in that specification.
Working Draft Sense canvis.
CSS Basic User Interface Module Level 3
The definition of ':required' in that specification.
Proposed Recommendation Defineix la pseudo-classe, però no la semàntica associada.

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Descripció Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic 10.0 (Yes) 4.0 (2) 10 10.0 5.0
Descripció Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic 4.4.4 (Yes) 4.0 (2) No support 10.0 5.0

Vegeu també

Document Tags and Contributors

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