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

标签 css permissions nginx icons font-face

我有font-awesome icon-font 在我的 locahost 和 mysite.com 上工作,它们都是 nginx 服务器。奇怪的是,当我尝试从 Glyphicons 实现类似的图标字体集时这些图标仅在 mysite.com 上呈现,但在我的本地主机上呈现。

以下是图标的正常外观与它们在本地主机上的外观:

正常: normal 查获: busted

问题是我的本地主机无法识别 font-family: 'Glyphicons' 属性,因为只需注释掉 mysite.com 上的 font CSS 属性即可-创建红色框外观:

.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-types 或任何其他与 Nginx 有关的东西,正如我最初想象的那样。

关于css - 图标字体(@font-face)未在本地主机上呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13886817/

相关文章:

ruby - rbenv 系统范围安装导致不安全操作

django - gevent-socketio nginx uwsgi不能在开发服务器上一起工作

wordpress - 使用 nginx 为 flask 应用程序启用 wordpress

html - CSS(顺风)网格高度 100vh 不工作

html - 如何覆盖 td align ="center"?

java - 到底什么时候请求运行时许可?

nginx - 后处理 Nginx 反向代理响应的最佳方法

css - 带有 CSS 粘性页脚的重叠 block + 960 网格布局

html - 将 iframe 从正文顶部拉伸(stretch)到页面底部

r - Windows 7,update.packages 问题 : "unable to move temporary installation"?