4

Yo everyone

My question is quite simple: I need to style the red border (or shadow?) of the inputs that couldn't be validated (like email). Is there any new CSS trick to do that?

If you still don't understand what I am telling you, then this is the color that needs changing: enter image description here

1 Answer 1

5

See https://developer.mozilla.org/en/CSS/%3Ainvalid for Firefox details, although presumably the parts without "-moz" apply to other browsers too:

The :invalid CSS pseudo-class is applied automatically to <input> elements whose contents fail to validate according to the input's type setting. This allows you to easily have invalid fields adopt an appearance that helps the user identify and correct errors.

By default, Gecko does not apply a style to the :invalid pseudo-class. However it does apply a style (a red "glow" using the box-shadow property) to the :-moz-ui-invalid pseudo-class, which applies in a subset of cases for :invalid.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.