HTML & CSS · Senior · Question 52 of 75

Why style errors with :user-invalid instead of :invalid?

Explanation

:invalid applies immediately, punishing users before they type. :user-invalid gives the "touched" behavior that previously needed JavaScript.

Further reading

Problem with a question

HTML & CSS · Senior · question 52

Test yourself

Take the HTML & CSS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz