我创建了一个课程
.image-upload .image-edit input + label:after {
content: "\f030";
font-family: 'FontAwesome';
color: #757575;
position: absolute;
top: 10px;
left: 0;
right: 0;
text-align: center;
margin: auto;
}
我需要更改相机图标(字体很棒,线条很棒)
我尝试过
.image-upload .image-edit input + label:after {
content: "\";
font-family: '"Line Awesome Free"';
color: #757575;
position: absolute;
top: 10px;
left: 0;
right: 0;
text-align: center;
margin: auto;
}
但是它不起作用
这是HTML表单
<form action=""#>
<div class="text-center">
<div class="avatar-upload">
<div class="avatar-edit">
<input name="input_file" type="file" id="profile-pic-upload" />
<label for="profile-pic-upload"></label>
</div>
</div>
</div>
</form>
答案 0 :(得分:0)
在您的html文件头中插入以下内容:
{'some_key':'some_value'}
您的CSS:
<link rel="stylesheet" href="https://maxst.icons8.com/vue-static/landings/line-awesome/line-awesome/1.3.0/css/line-awesome.min.css">
您的html:
label:after {
content: "\f030";
font-family: "Line Awesome Free";
color: #757575;
position: absolute;
top: 10px;
left: 0;
right: 0;
text-align: center;
margin: auto;
}
最好直接使用:
<form action="#">
<div class="text-center">
<div class="avatar-upload">
<div class="avatar-edit">
<input name="input_file" type="file" id="profile-pic-upload" />
<label for="profile-pic-upload"></label>
</div>
</div>
</div>
</form>
答案 1 :(得分:0)
label:after {
content: "\f030";
font-family: "Line Awesome Free";
color: #757575;
position: absolute;
top: 10px;
left: 0;
right: 0;
text-align: center;
margin: auto;
}
此代码是正确的,但您还必须添加font-weight:900;