Forked from Zachary Kain's Pen CSS-Tricks, :valid & :invalid.
Forked from anonymous/CSS-Tricks, :valid & :invalid.markdown
Created
June 28, 2015 02:08
-
-
Save taliwalt/16b6abb89b4d29c534ad to your computer and use it in GitHub Desktop.
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