字体真棒图标未在Angular4项目上加载

编程入门 行业动态 更新时间:2024-10-15 12:32:26
本文介绍了字体真棒图标未在Angular4项目上加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用font-awesome进行angular 4项目,我按照此指南使用npm安装该库:

解决方案

您应该使用fa而不是fas类.fa类设置字体.(向@ mike-hill提示)

查看源 fontawesome.io/icon/address-card/

I'm working on an angular 4 project using font-awesome, i followed this guide to install the library with npm: How to add font-awesome to Angular 2 + CLI project

i've configured the project to compile the scss stylesheets with the ng-serve command, my styles paths of the angular-cli.json looks like this:

"styles": [ "../node_modules/bootstrap/scss/bootstrap.scss", "../node_modules/bootstrap/scss/main.scss", "../node_modules/font-awesome/scss/font-awesome.scss" ],

i want to make a button with an address card icon on it, i'm also working with Bootstrap 4, so it looks like this:

<button class="btn btn-sm btn-primary"><span class="fas fa-address-card"></span></button>

but when it loads, it looks like this:

解决方案

You should be using the class fa instead of fas. The fa class sets the font-face. (hat tip to @mike-hill)

View source on fontawesome.io/icon/address-card/

更多推荐

字体真棒图标未在Angular4项目上加载

本文发布于:2023-11-16 01:45:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1599880.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图标   真棒   加载   字体   项目

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!