CSS :user-invalid Pseudo-class
Example
Style invalid <input> elements, after the user has interacted with it:
input:user-invalid {
border: 2px solid red;
background-color: beige;
}
Try it Yourself »
Definition and Usage
The :user-invalid
pseudo-class is used to style
invalid form elements, after the user has interacted with it.
Tip: Use the :user-valid pseudo-class to style valid form elements (after user has interacted).
Version: | CSS4 |
---|
Browser Support
The numbers in the table specifies the first browser version that fully supports the pseudo-class.
Pseudo-class | |||||
---|---|---|---|---|---|
:user-invalid | 119 | 119 | 88 | 16.5 | 105 |
CSS Syntax
:user-invalid {
css declarations;
}
Related Pages
CSS Selector :user-valid