图标字体(@ font-face)不在本地主机上呈现

我有我的locahost上的字体真棒图标字体以及我的mysite.com都是nginx服务器。 奇怪的是,当我试图从Glyphicons实现一个类似的图标字体集的图标只在mysite.com呈现,但不是我的本地主机。

以下是图标看起来像通常与他们如何看我的本地主机:

正常: 正常 猛击: 破获

问题是font-family: 'Glyphicons'属性在我的本地主机上没有被识别,因为只是注释掉mysite.com上的font CSS属性重新创build红框外观:

 .glyphicons i::before { position: absolute; left: 0; top: 0; font: 24px/1em 'Glyphicons'; // commenting out this line re-creates the red box pattern font-style: normal; color: #1D1D1B; color: red; } 

我想感谢@David(请参阅上面的评论)帮助我回答自己的问题。 这个问题是一个文件权限问题。 我刚刚添加Glyphicons文件夹到我的本地主机应用程序文件夹(即,/ HTML),它没有正确的权限。 只需在命令行输入以下内容即可解决问题:

 html TimPeterson$ chmod -R 777 assets/glyphicons/ /*this command allows access to all (777) for all files and folders (-R) within the glyphicons folder*/ 

所以不像我原先想象的那样,不是CSS,MIME类型,或者其他任何与Nginx相关的东西。