We will look at what CSS selectors to use to change an HTML5 inputs placeholder color. This can differ from browser to browser, so, we will make sure to cover all of the cases.
/* Chrome, Opera, Safari */ ::-webkit-input-placeholder { color: #ff6600; opacity: 1; } /* Firefox 19+ */ ::-moz-placeholder { color: #ff6600; opacity: 1; } /* Firefox 18 and below */ :-moz-placeholder { color: #ff6600; opacity: 1; } /* MS IE 10+ */ :-ms-input-placeholder { color: #ff6600; opacity: 1; }
[HTML] Change an HTML5 input's placeholder color with CSS
时间: 2024-10-12 13:04:15