:user-error

User-Interaction

The :user-error pseudo-class represents an input element with incorrect input, but only after the user has interacted with it.

:user-error must match an :invalid, :out-of-range, or empty :required form element.

Browser Support (tested using latest versions)

Desktop
Google Chrome
No
Mozilla Firefox
Yes
Safari
No
Opera Browser
No
Internet Explorer
No
Mobile
Android Browser
No
Chrome for Android
No
Mozilla Firefox Mobile
No
Safari iOS
No
Opera Mobile
No
IE Mobile
No

Syntax

E:user-error {
/* Style properties */
}

Example

/* In this example, any input element that is invalid, out of range, or required (but empty), AFTER the user has interacted with it, will have a red background. */

input:user-error {
background-color: red;
}

Information is based on Selectors Level 4 - W3C Working Draft (last updated on May 2, 2013)
Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C liability, trademark and document use rules apply.