CSS :valid Selector
Select and style only if the value of the <input> element is valid:
Definition and Usage
:valid selector selects form elements with a value that validates according to the element's settings.
Note: The :valid selector only works for form elements with limitations, such as input elements with min and max attributes, email fields with a legal email, or number fields with a numeric value, etc.
Tip: Use the :invalid selector to select form elements with a value that does not validate according to the element's settings.
The numbers in the table specifies the first browser version that fully supports the selector.
CSS Selector :invalid