This article introduces the method of defining Required,focus,valid and invalid styles in CSS3, which currently only supports ie9+ and FF,GG browsers.
CSS3 hints are only available for advanced browsers:
Chrome
Firefox
Safari
ie9+
Definition of valid, invalid, required
Input:required, Input:valid, input:invalid{ border:0 none; outline:0 none; -webkit-box-shadow:none; -moz-box-shadow:none; -ms-box-shadow:none; -o-box-shadow:none; Box-shadow:none; } /* by http://www.manongjc.com/article/1327.html */
In the past, the verification form will use JS and regular to determine whether the content is correct, such as email verification.
The appearance of HTML5 provides us with some attributes that can be solved without writing JS and regular.
: Required
must, that input cannot be empty meaning.
: Valid
Valid, that is, when the content is filled to meet the requirements of the trigger.
: invalid
Invalid, that is, when the content is not met the requirements of the trigger.