最近开发项目的时候经常遇到修改input里面的placeholder的字体颜色,每次遇到都要去网上查找,于是这篇文章专门整理了一下
要求:
实现的效果
实现代码:
/* WebKit browsers */
input::-webkit-input-placeholder {
color: #ccc;
}
/* Mozilla Firefox 4 to 18 */
input:-moz-placeholder {
color: #ccc;
}
/* Mozilla Firefox 19+ */
input::-moz-placeholder {
color: #ccc;
}
/* Internet Explorer 10+ */
input:-ms-input-placeholder {
color: #ccc;
}