Created
May 2, 2014 18:33
-
-
Save brito/11482737 to your computer and use it in GitHub Desktop.
flexy inputs
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
| /* flexy inputs */ | |
| label { display:flex; align-items:baseline } | |
| label:before { content:attr(aria-label); text-align:right; flex:1 } | |
| label>* { flex:1 } | |
| /* just to look nicer */ | |
| html { background:white } | |
| body { font:16px/1.6 HelveticaNeue-Light; | |
| background:#eee; min-width:21em; max-width:50%; margin:auto; | |
| padding:0 } | |
| h1 { text-align:center; font:25px/1 HelveticaNeue-CondensedBold } | |
| input, textarea { margin:.3em 0; | |
| font-size:inherit; font-family:inherit; line-height:inherit } | |
| /* so you can see the layout boxes */ | |
| label, label:before { outline:1px solid } | |
| body:before { content:''; position:absolute; left:50%; width:0; top:0; bottom:0; display:block; border:1px dashed } |
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
| <h1>Flex centering: seems legit</h1> | |
| <label aria-label=agnomen> <input placeholder="write your name here"> </label> | |
| <label aria-label=predisposition> <input placeholder="political affiliations"> </label> | |
| <label aria-label=quantization> <input placeholder="solutions of the classical Maxwell equations"> </label> | |
| <label aria-label=verbiage> <textarea placeholder="sales pitch"></textarea> </label> |
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
| // alert('Hello world!'); |
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":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"html"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment