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

WBOY
Release: 2016-06-24 11:19:38
Original
1099 people have browsed it

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

<input type="text" placeholder="搜索" value=" ">
Copy after login

默认的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;}
Copy after login

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template