![input提示文字;placeholder字体修改 input提示文字;placeholder字体修改](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
在很多网站上我们都看到input输入框显示提示文字,让我们一起来看看如果在input输入框中显示提示文字。我们只需要在<input>标签里添加:placeholder="提示文字即可"。
<style>
/*修改提示文字的颜色*/
input::-webkit-input-placeholder { /* WebKit browsers */
color: red;
}
input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: red;
}
input::-moz-placeholder { /* Mozilla Firefox 19+ */
color: red;
}
input:-ms-input-placeholder { /* Internet Explorer 10+ */
color: red;
}
input { color:blue; }
</style>
设置以后如果input 有placeholder,字体会变成红色,然后输入文字后,文字马上会变成蓝色