Pau*_*ula 2 html5 css3 font-awesome
我知道SO中有很多类似的问题,但是由于某种原因,提供的答案对我不起作用。我本来要使用这个字体超棒的图标,但不会显示。当我尝试其他图标时,它们会起作用。我一直在关注本文档。
.input-validation-error input {
border: 2px solid #f46262;
}
.input-validation-error input[type="text"] {
position: relative;
}
.input-validation-error::before {
font-family: "Font Awesome 5 Free";
color: red;
position: relative;
content: "\f06a";
}Run Code Online (Sandbox Code Playgroud)
<!-- FONT AWESOME -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<form class="registration-form">
<div class="form-group input-validation-error">
<input type="text" class="form-control" id="formGroupExampleInput" placeholder="Nombre de usuario">
</div>
</form>Run Code Online (Sandbox Code Playgroud)
您必须设置font-weight属性。您可以尝试一下,它现在应该可以工作:
.input-validation-error::before {
font-family: "Font Awesome 5 Free";
color: red;
position: relative;
content: "\f06a";
font-weight: 900;
}
Run Code Online (Sandbox Code Playgroud)