Home  >  Article  >  Web Front-end  >  修改输入框placeholder文字默认颜色-webkit-input-placeholder_html/css_WEB-ITnose

修改输入框placeholder文字默认颜色-webkit-input-placeholder_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:19:381093browse

html5为input添加了原生的占位符属性placeholder,高级浏览器都支持这个属性,例如:

<input type="text" placeholder="搜索" value=" ">

默认的placeholder字体颜色是呈浅灰色,如果想改变这个默认颜色,解决方案如下:

input:-moz-placeholder,textarea:-moz-placeholder {    color: #999999;}input:-ms-input-placeholder,textarea:-ms-input-placeholder {    color: #999999;}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder {    color: #999999;}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn