真棒字体不显示其图标

Font awesome does not show its icons

我想了几分钟为什么 Font awesome 图标没有出现在我的应用程序中,但是在写完这个 ultra-simple fiddle 之后,我发现即使代码很少,它们也根本没有出现。

我只是加载 CDN 并插入这样的图标:

<!-- Font awesome stylesheet -->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

<i class="fa fa-camera-retro fa-5x">This is a camera</i>
<i class="fa fa-icon-remove fa-2x" style="color: red;">This is an X</i>

我错过了什么?

如果使用 jsfiddle,您必须在外部资源下添加以下内容link:

//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css

或者在你的头部部分使用这个:

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

您的 jsfiddle 已更新。

试试这个:

<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

<i class="fa fa-camera-retro fa-5x">This is a camera</i>
<i class="fa fa-remove fa-2x" style="color: red;">This is an X</i>

这里是fiddle

几个错误。

  1. 没有 fontAwesome 库
  2. 输入错误的图标class

解法:

将下面的 link 添加到 fiddle

上为外部资源提供的 space
//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css

然后改

<i class="fa fa-icon-remove fa-2x" style="color: red;">This is an X</i>

<i class="fa fa-remove fa-2x" style="color: red;">This is an X</i>

注意: fa 和 [=] 之间不需要 icon 这个词28=]移除.

See it working here