:user-invalid (:-moz-ui-invalid)
Quick Summary for :user-invalid
The :user-invalid CSS pseudo-class represents any validated form element whose value isn't valid based on their validation constraints, after the user has interacted with it.
Code Usage for :user-invalid
<form>   <label for="email">Email *: </label>   <input id="email" name="email" type="email" required>   <span></span> </form> 
More Details for :user-invalid

:user-invalid (:-moz-ui-invalid)

The :user-invalid CSS pseudo-class represents any validated form element whose value isn't valid based on their validation constraints, after the user has interacted with it.

The :user-invalid pseudo-class must match an :invalid, :out-of-range, or blank-but :required element between the time the user has attempted to submit the form and before the user has interacted again with the form element.

Note: The pseudo-class behaves in the same way as the non-standard :-moz-ui-invalid pseudo-class.

Syntax

:user-invalid

Examples

Setting a color and symbol on :user-invalid

In the following example, the red border and ❌ only display once the user has interacted with the field. Try typing something other than an email address to see it in action.

<form>   <label for="email">Email *: </label>   <input id="email" name="email" type="email" required>   <span></span> </form> 
input:user-invalid {   border: 2px solid red; }  input:user-invalid + span::before {   content: '✖';   color: red; } 

Specifications

Specification
Selectors Level 4 # user-invalid-pseudo

See also

:valid :invalid :required :optional :user-valid

Last modified: Aug 12, 2021, by MDN contributors

Select your preferred language English (US)DeutschEspañolFrançais日本語 Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote


Me
Random CSS Property

text-decoration

The text-decoration shorthand CSS property sets the appearance of decorative lines on text. It is a shorthand for text-decoration-line, text-decoration-color, text-decoration-style, and the newer text-decoration-thickness property.
text-decoration css reference