简体   繁体   English

如何链接到字体真棒安装的路径

[英]How to link path to font-awesome installation

I am pretty new to angular and the like.我对 angular 等很陌生。 I am trying to link the font-awesome stylesheet, and I was to reference the path to the css folder of the font-awesome installation.我正在尝试链接 font-awesome 样式表,并且我要引用 font-awesome 安装的 css 文件夹的路径。 I have used npm to install font-awesome, and when I reference font-awesome, I don't want to link to a website, I want to use the path that it is installed to.我已经使用 npm 安装 font-awesome,当我引用 font-awesome 时,我不想链接到网站,我想使用它安装到的路径。

The problem comes when I try to make the path more universal.当我尝试使路径更通用时,问题就来了。 If I have font-awesome installed to the repo that I am using, and I want anyone who uses the app to be able to see these icons, how can I write the path so that I don't put my own directories before the repo in the path?如果我在我正在使用的 repo 中安装了 font-awesome,并且我希望使用该应用程序的任何人都能够看到这些图标,我该如何编写路径以便我不会将我自己的目录放在 repo 之前在路径中?

For example, If the folder I am trying to link is at path C:/Users/Me/path/to/folder/font-awesome/css, how can I write this path so that anyone who uses the app can use the same path that will find the same folder in their system?例如,如果我要链接的文件夹位于路径 C:/Users/Me/path/to/folder/font-awesome/css,我该如何编写此路径以便使用该应用程序的任何人都可以使用相同的路径将在他们的系统中找到相同文件夹的路径?

1.keep complete font-awesome folder in assets folder. 1.在assets文件夹中保留完整的font-awesome文件夹。

  1. go to angular.json go 至 angular.json

  2. in styles array give path of /fontawesome/css/all.min.css在 styles 数组中给出 /fontawesome/css/all.min.css 的路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM