样式文本输入占位符 [英] Style text input placeholder

查看:96
本文介绍了样式文本输入占位符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

使用CSS更改输入的HTML5占位符颜色

有没有样式的文本输入中的占位符的颜色?现在我陷入无聊的默认灰色。

Is there anyway to style the color of a placeholder in a text input? Right now I'm stuck with the boring default grey.

推荐答案

你确定可以http://css-tricks.com/snippets/css/style-placeholder-text/

(来自上述文章)

::-webkit-input-placeholder {
    color: red;
}

:-moz-placeholder { /* Firefox 18- */
    color: red;  
}

::-moz-placeholder {  /* Firefox 19+ */
    color: red;  
}

:-ms-input-placeholder {  
   color: red;  
}

或检查MDN https://developer.mozilla.org/en-US/docs/CSS/:-moz-placeholder

这篇关于样式文本输入占位符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆