Forked from Zachary Kain's Pen CSS-Tricks, :valid & :invalid.
Created
June 28, 2015 02:08
-
-
Save anonymous/299ee7e11abb6f1ef9f3 to your computer and use it in GitHub Desktop.
CSS-Tricks, :valid & :invalid
This file contains hidden or 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
<fieldset> | |
<label for="email">Email:</label> | |
<input type="email" name="email"> | |
</fieldset> | |
<fieldset> | |
<label for="emailRequired">Email (required):</label> | |
<input type="email" name="emailRequired" required> | |
</fieldset> |
This file contains hidden or 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:invalid { | |
background: hsla(0, 90%, 70%, 1); | |
} | |
input:valid { | |
background: hsla(100, 90%, 70%, 1); | |
} | |
body { | |
padding: 3em; | |
} | |
fieldset { | |
border: 0; | |
} | |
input { | |
padding: 0.25em 0; | |
margin-bottom: 0.75em; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment