我有一个html的联系表单,我给了输入字段的字体很棒的图标,oce如下:
null
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="wrap-input100">
<input class="input100" type="number" name="pass" placeholder="Mobile Number">
<span class="focus-input100" data-placeholder=""></span>
</div>
<div class="wrap-input100">
<input class="input100" type="text" name="question" placeholder="Your Query">
<span class="focus-input100" data-placeholder=""></span>
</div>
null
但是字体awesome似乎不起作用,有人能告诉我这里有什么问题吗
使用font-awesome时,不需要添加数据占位符
。 你应该使用如下所示的类字体:
<span class="focus-input100 fa fa-phone"></span>
<span class="focus-input100 fa fa-question"></span>
null
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="wrap-input100">
<input class="input100" type="number" name="pass" placeholder="Mobile Number">
<span class="focus-input100 fa fa-phone"></span>
</div>
<div class="wrap-input100">
<input class="input100" type="text" name="question" placeholder="Your Query">
<span class="focus-input100 fa fa-question"></span>
</div>
要使用字体出色的图标,请不要使用data-placeholder
。 字体Awesome是一种将字形转换为图标的字体。 因此,您的固定代码是:
null
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="wrap-input100">
<input class="input100" type="number" name="pass" placeholder="Mobile Number">
<span class="focus-input100 fa"></span>
</div>
<div class="wrap-input100">
<input class="input100" type="text" name="question" placeholder="Your Query">
<span class="focus-input100 fa"></span>
</div>
使用字体awesome在输入占位符,你可以使用这个代码。
null
input {
font-family: FontAwesome;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="wrap-input100">
<input class="input100" type="number" name="pass" placeholder=" Mobile Number ">
</div>
<div class="wrap-input100">
<input class="input100" type="text" name="question" placeholder=" Your Query" >
</div>