Created
March 8, 2013 15:50
-
-
Save daphotron/5117395 to your computer and use it in GitHub Desktop.
CSS color applied to placeholder pseudo class
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
| /* Broken on chrome, (comment out "works on chrome code") */ | |
| #field::-webkit-input-placeholder, | |
| #field:input-placeholder { color: red; } | |
| /* Works on chrome */ | |
| #field::-webkit-input-placeholder { color: red; } | |
| #field::-moz-placeholder { color: red; } | |
| #field:-moz-placeholder { color: red; } | |
| #field:-ms-input-placeholder { color: red; } | |
| #field:input-placeholder { color: red; } /* Put this last. */ | |
| /* Learnings: | |
| Cannot comma separate and put :input-placeholder last | |
| even though best practices dictate we should. */ | |
| /* http://davidwalsh.name/demo/placeholder-style.php */ |
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 type="text" value="" id="field" placeholder="search"> |
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":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment