Last active
January 8, 2018 07:51
-
-
Save imsarvesh/c43d7999c775dffec96e19e32b921dd5 to your computer and use it in GitHub Desktop.
CSS valid & invalid textbox validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input:not(:focus):valid { | |
border: 1px solid green; | |
} | |
input:not(:focus):valid + span::after { | |
content: '✓'; | |
} | |
input:not(:focus):invalid { | |
border: 1px solid red; | |
} | |
input:not(:focus):invalid + span::after { | |
content: '×'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment