← TechnologyThe essentials of

:invalid: a control that fails browser validation

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 13:48. This is not editorial approval.

In a few sentences

In brief

CSS can indicate a problem, but does not validate the server data.

Useful to know

:invalid selects a control or form that does not meet the validity limits of HTML. For example, a required email field may match if it is empty or has an inappropriate value. [1]

Example: input:invalid { border-color: firebrick; }. This is a visual signal, not an application protection. The server must verify the submitted data itself. Think and when you show the error: a red form even before the first introduction can confuse the reader. Add an understandable textual explanation and don't just rely on the red frame.

Sources

For further detail and to check the information:

  1. [1] MDN — :invalid ↗