我有一个带有占位符的输入框,占位符文本非常大胆,我想让它更薄。我查看了这个资源http://coolestguidesontheplanet.com/styling-placeholder-text-input-fields-forms-css/,它提供了更改字体权重的代码,但它没有用。到目前为止,这是我的代码:
.infoPlaceholder::-ms-input-placeholder {
font-weight: lighter;
}
<input class="infoPlaceholder" name="firstName" placeholder="First Name"/>
然而,这并没有改变我的占位符的重量。对我来说似乎还是很大胆。我的代码有问题吗?或者是否有其他方法可以产生这种效果?
答案 0 :(得分:0)
<强> CSS: - 强>
.infoPlaceholder::-webkit-input-placeholder {
font-weight: lighter;
color:#AFB2B3;
}
.infoPlaceholder::-moz-placeholder {
font-weight: lighter;
color:#AFB2B3;
}
.infoPlaceholder::-ms-input-placeholder {
font-weight: lighter;
color:#AFB2B3;
}
答案 1 :(得分:0)
font-weight属性还接受100到900之间的数值,以指定文本的亮度或粗体应该是多少,100为最亮,900为最大胆。如果使用&#34; font-weight:打火机;&#34;不起作用,我建议改为试验数值。这些方面的东西:
.infoPlaceholder::-ms-input-placeholder {
font-weight: 100;
}