html - FontAwesome 从网络链接加载,但在 xCode 上本地失败

标签 html css xcode font-awesome

我在我的 xCode 元素中使用 fontAwesome,我正在加载一个本地 html 文件,带有一些自定义的 css 样式,我还需要添加一些在 fontAwesome 中定义的图标,问题是如果我在 HTML 标题中提供网站链接它加载字体,如果在 HTML header 中提供本地 CSS 链接它不会加载,同时我确保所有这些文件都添加到我的元素中并且目标成员资格也设置为元素。

<head>
    <link href='../fonts/font-awesome.min.css' rel='stylesheet' type='text/css'></head>

这是行不通的。如屏幕截图所示添加文件。 Image Showing FontAwesome assets added in Project 但这很好用。

<head>
    <link href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'></head>

我在这里错过了什么?

最佳答案

css 文件需要在你的 css 文件夹中,它们在 font awesome css 文件中采用的路径是 ../webfonts/whateverfontyouwant 其他文件应该在同一个 webfonts 文件夹中水平作为你的CSS。这来自刚刚下载的 font awesome,如果您有旧版本,只需打开 css 文件,您就会看到它们采用的路径。

关于html - FontAwesome 从网络链接加载,但在 xCode 上本地失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50259046/

相关文章:

ios - 错误 : unable to load standard library for target 'arm64-apple-ios10.0-simulator' ?

html - flex 盒/IE11 : flex-wrap: wrap does not wrap (Images + Codepen inside)

html - 响应式布局中的溢出滚动

动态重叠父 div 的 HTML 表格

c++ - 我究竟应该在我的 OpenGL C++ 项目中的什么地方添加我的 BMP 文件?使用适用于 Mac 的 Xcode

ios - Xcode swift - 无法使用类型为 'pathForResource' 的参数列表调用 '(String!)'

javascript - 自定义 HTML Shiv 的缺点

html - DIV设置溢出时内容跳到顶部

html - CSS 字体显示不正常

html - 你会将 Twitter Bootstrap 用于内部网/业务应用程序吗?