我的网站上有3种形式,我想要设置其占位符的样式。我想在网站上的所有其他输入保持自己的造型。 在我看来,我管理的一个形式的作风投入,但如何组样式的所有3种形式风格输入占位符
.one-form input::-webkit-input-placeholder { color: #d6d6d6; }
.one-form input:-moz-placeholder { /* Firefox 18- */ color: #d6d6d6; }
.one-form input::-moz-placeholder { /* Firefox 19+ */ color: #d6d6d6; }
.one-form input:-ms-input-placeholder { color: #d6d6d6; }
<form class="one-form" action="" method="post">
<input type="text" name="log" placeholder="Username"/>
<input type="password" name="pwd" placeholder="Password" />
<input type="submit" name="1-submit" id="1-submit" value="Start" /> \t
</form>
<form class="three-form" action="" method="post">
<input type="text" name="smthing" placeholder="Username"/>
<input type="password" name="someth" placeholder="Password" />
<input type="submit" name="1-submit" id="1-submit" value="Start" /> \t
</form>
<form class="two-form" action="" method="post">
<input type="text" name="smth" placeholder="Username"/>
<input type="password" name="some" placeholder="Password" />
<input type="submit" name="1-submit" id="1-submit" value="Start" /> \t
</form>
我问,因为我读somwhere,如果你组的CSS它将完全
是的,它现在很清楚 – kilogram
@千克这个答案有它需要的代码量的3倍。你最好把一个普通的类放在元素上,所以你只需要一次样式:http://stackoverflow.com/a/40765857/4573410 –
哦,是的,我现在也这样想。我正在举办一个共同课 – kilogram