您的位置:首页 > 其它

修改input里placeholder颜色

2017-02-07 14:42 246 查看
2017年第一天上班!
开工大吉!


 

  html   
 如下:


<input type="text" placeholder="请输入密码" />
 Chrome支持input=[type=text]占位文本属性    所以,对下面这段代码并不起作用,另外,!important只有IE7和firefox能识别!
input[placeholder], [placeholder], *[placeholder] {
color:#333 !important;
}

修改input里placeholder颜色的方法有很多,我比较喜欢的一种:
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
/* WebKit browsers */
color: #666;
}
input:-moz-placeholder, textarea:-moz-placeholder {
/* Mozilla Firefox 4 to 18 */
color: #666;
}
input::-moz-placeholder, textarea::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #666;
}
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #666;
}
其他方法有兴趣的同学可以一起交流喔!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  input placehoder