Skip to content

Instantly share code, notes, and snippets.

@Donmclean
Created September 19, 2015 15:36
Show Gist options
  • Save Donmclean/78e10294420cf7432094 to your computer and use it in GitHub Desktop.
Save Donmclean/78e10294420cf7432094 to your computer and use it in GitHub Desktop.
This Code selects and alters html5 Placeholder elements. You can now style them to whatever you want.
::-webkit-input-placeholder { color: #000; font-family: sans-serif; }
::-moz-placeholder { color: #000; font-family: sans-serif; }
:-ms-input-placeholder { color: #000; font-family: sans-serif; }
input:-moz-placeholder { color: #000; font-family: sans-serif; }
.required::-webkit-input-placeholder:after { content: "*"; color: red; }
.required::-moz-placeholder:after { content: "*"; color: red; }
.required:-ms-input-placeholder:after { content: "*"; color: red; }
.requiredinput:-moz-placeholder:after { content: "*"; color: red; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment