Invalid Pseudo Class - CSS Pseudo | CSS: Presentation Layer
Standards Based Development
:invalid pseudo class.
The following code will show a green input text when completed and a yellow one when incomplete:
<style>
input {
background-color: green;
color: white;
}
input:invalid {
background-color: yellow;
}
</style>
<input type="text" required>