Skip to content

Instantly share code, notes, and snippets.

@wycliffepeart
Created December 22, 2017 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wycliffepeart/244e15ef95afa1ee3f76ccb3ba0aa2b9 to your computer and use it in GitHub Desktop.
Save wycliffepeart/244e15ef95afa1ee3f76ccb3ba0aa2b9 to your computer and use it in GitHub Desktop.
form input placeholder color
input {
outline: none;
padding: 12px;
border-radius: 3px;
border: 1px solid black;
}
::-webkit-input-placeholder { /* Chrome */
color: red;
transition: opacity 250ms ease-in-out;
}
:focus::-webkit-input-placeholder {
opacity: 0.5;
}
:-ms-input-placeholder { /* IE 10+ */
color: red;
transition: opacity 250ms ease-in-out;
}
:focus:-ms-input-placeholder {
opacity: 0.5;
}
::-moz-placeholder { /* Firefox 19+ */
color: red;
opacity: 1;
transition: opacity 250ms ease-in-out;
}
:focus::-moz-placeholder {
opacity: 0.5;
}
:-moz-placeholder { /* Firefox 4 - 18 */
color: red;
opacity: 1;
transition: opacity 250ms ease-in-out;
}
:focus:-moz-placeholder {
opacity: 0.5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment