项目中经常会遇到要自定义input框中placeholder的文字的样式的问题,这篇文章用来总结下
input::-webkit-input-placeholder{
/* WebKit browsers */
color: #c2c2c2;
}
input:-moz-placeholder{
/* Mozilla Firefox 4 to 18 */
color: #c2c2c2;
}
input::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #c2c2c2;
}
input:-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #c2c2c2;
}
本文介绍如何使用CSS针对不同浏览器自定义input元素中的placeholder文字样式,包括颜色等属性。

2万+

被折叠的 条评论
为什么被折叠?



