angular - Fontawesome 图标未在 Angular 项目中显示
问题描述
我已经使用 npm 安装了 fontawesomenpm install --save font-awesome
然后我将 css 添加到我的 angular.json 中,如下所示:
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/font-awesome/css/font-awesome.min.css",
"src/styles.css"
],
然后我将它添加到我的 html 文件中:
<button type="button" class="btn btn-outline-primary">
<i class="fa fa-arrow-left"></i>
</button>
在我的网页上显示一个空按钮,我做错了什么?
解决方案
You can give the address in the styles.scss instead of the address in the package
this way should work
@import "~font-awesome/css/font-awesome.min.css";
推荐阅读
- java - Java字符串文本规范器重复朝鲜语字符
- angular - 如何在 TypeScript 中为对象元素指定接口类型?
- java - 我们如何接受多部分的请求正文?
- python-3.x - 使用opencv从USB摄像头获取当前帧
- android - 屏幕熄灭时如何保持应用程序运行(最新的android)
- json - Scala 中的 JSON 压缩
- javascript - 使用 mat-slide-toggle 切换两个类
- html - 如何在 Onsen UI 工具栏中有多个 p 标签?
- asp.net-core - 如何在 Asp.Net (Core) Code First 中调用动态存储过程?
- azure - Kubernates 网络:我的前端无法访问后端