Google Chrome和Mozila Firefox支持输入的占位符属性.如何更改占位符颜色我的代码是
<input type="text" placeholder="change color" />
Run Code Online (Sandbox Code Playgroud)
cgv*_*tor 17
对于Mozilla <19
<style type="text/css">
input:-moz-placeholder {
color: green;
}
</style>
Run Code Online (Sandbox Code Playgroud)
对于Mozilla 19起
<style type="text/css">
input::-moz-placeholder {
color: green;
}
</style>
Run Code Online (Sandbox Code Playgroud)
对于谷歌浏览器
<style type="text/css">
input::-webkit-input-placeholder {
color: green;
}
</style>
Run Code Online (Sandbox Code Playgroud)
对于IE 10
<style type="text/css">
input:-ms-input-placeholder {
color: green;
}
</style>
Run Code Online (Sandbox Code Playgroud)