Skip to content

Instantly share code, notes, and snippets.

@daphotron
Created March 8, 2013 15:50
Show Gist options
  • Select an option

  • Save daphotron/5117395 to your computer and use it in GitHub Desktop.

Select an option

Save daphotron/5117395 to your computer and use it in GitHub Desktop.
CSS color applied to placeholder pseudo class
/* 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 */
<input type="text" value="" id="field" placeholder="search">
{"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