占位符字体样式对于textfield和textarea来说是不同的

时间:2014-05-05 11:07:52

标签: html css

我有一个带有textfield和textarea的表单,并且它们都有一个占位符。但是,与textfield和textarea相比,占位符的字体样式不同。请告诉我如何保持相同的字体样式。

<form> 
    <input type="text" placeholder="just for testing the style">
    <textarea placeholder="just for testing the style"></textarea>
</form>

2 个答案:

答案 0 :(得分:0)

您需要提及textarea的字体系列,例如 here

<强> CSS

textarea{font-family:arial;}

答案 1 :(得分:0)

您需要在CSS中将它们设置为相同的字体系列:

textarea,
input[type=text] {
    font-family:Arial;
}