项目用经常遇到修改input的placeholder的颜色的需求,这里来看一下placeholder如何用css设置。
要改变placeholder的颜色就要使用到伪类::placeholder
<style>
input::placeholder {
color: green;
}
</style>
<input type="text" placeholder="hello world" style="color: red;">
项目用经常遇到修改input的placeholder的颜色的需求,这里来看一下placeholder如何用css设置。
要改变placeholder的颜色就要使用到伪类::placeholder
<style>
input::placeholder {
color: green;
}
</style>
<input type="text" placeholder="hello world" style="color: red;">