正文
[HTML] Change an HTML5 input's placeholder color with CSS
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
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:;
}
/* Firefox 19+ */
::-moz-placeholder {
color: #ff6600;
opacity:;
}
/* Firefox 18 and below */
:-moz-placeholder {
color: #ff6600;
opacity:;
}
/* MS IE 10+ */
:-ms-input-placeholder {
color: #ff6600;
opacity:;
}