css - Font Awesome 库无法与 Angular 元素中的 Angular Material 库一起使用

标签 css angular font-awesome angular-material-theming

我试图在我的元素中使用 font awesome css,但 css 没有应用于 HTML 元素。 如果我删除 Angular Material 主题,那么只有 Font Awesome CSS 可以工作。但是 Angular Material Components 将不起作用!!!

@import "~font-awesome/css/font-awesome.css";
@import "~@angular/material/prebuilt-themes/indigo-pink.css";

对此的任何指导 - enter image description here

最佳答案

在 angular.json 中,我们有 styles 属性,可以加载第三方 css 文件。

"styles": [
     "node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
     "font-awesome/css/font-awesome.css"
],

关于css - Font Awesome 库无法与 Angular 元素中的 Angular Material 库一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51687773/

相关文章:

.net - 大字符串而在 POST 期间忽略空格后的字母

javascript - npm run build 出错

css - Fontawesome 加载不出来

css - 如何在无限动画中从开始返回之前暂停动画的最后一步

html - 如何将类调用到 css3 中的另一个类?

html - CSS:将多个图像彼此靠近

html - 如何在点击时更改按钮颜色?

css - 柔性布局中的 Angular Material 进度微调器大小

angular - APP_INITIALIZER阻止在错误时加载应用

html - CSS Font Awesome 图标在 IE 10 中可点击