Created
October 2, 2012 11:25
-
-
Save gunnarbittersmann/3818306 to your computer and use it in GitHub Desktop.
mark required fields
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
| /** | |
| * mark required fields | |
| */ | |
| label | |
| { | |
| display: inline-block; | |
| position: relative; | |
| width: 9rem; | |
| } | |
| label::after | |
| { | |
| content: '*'; | |
| position: absolute; | |
| right: 0.5rem; | |
| } | |
| input | |
| { | |
| position: relative; | |
| z-index: 0; | |
| } | |
| input:not([required]) | |
| { | |
| box-shadow: -2rem 0 0 0 white; | |
| } | |
| button | |
| { | |
| margin-left: 9rem; | |
| } | |
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
| <form> | |
| <p> | |
| <label for="required-field">required field</label> | |
| <input id="required-field" required="required"/> | |
| </p> | |
| <p> | |
| <label for="not-required-field">not required field</label> | |
| <input id="not-required-field"/> | |
| </p> | |
| <button type="submit">submit</button> | |
| </form> |
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
| {"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment