【问题标题】:Bootstrap glyphicons (fonts/****.woff) not loading引导字形图标(字体/****.woff)未加载
【发布时间】:2017-08-24 00:41:57
【问题描述】:

在我的 Google chrome(56.0.2924.87) 控制台中尝试使用引导 glyphicons 时出现类似这样的错误

即使我的 .woff 文件和 .ttf 文件位于我的“public/css/fonts”文件夹中。

其他信息

我正在使用 Wampserver 和 apache(2.4.23)

我使用“npm install bootstrap”安装了 bootstrap.css

这就是我的字体外观

@font-face {
  font-family: 'Glyphicons Halflings';
  font-style: italic;
  src: url('/public/css/fonts/glyphicons-halflings-regular.eot');
  src: url('/public/css/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('/public/css/fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('/public/css/fonts/glyphicons-halflings-regular.woff') format('woff'), url('/public/css/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('/public/css/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');

}

我尝试这样调用字形图标:

<i class="glyphicon glyphicon-chevron-left"></i>

有人知道这个问题可能出在哪里吗?

【问题讨论】:

  • “无效的版本标签”,你能显示你的 html/css 吗? (您在哪里调用字体并调用引导程序)
  • @Thomas Rbt 编辑了更多信息
  • @Thomas Rbt bootstrap 工作正常,除了字形图标

标签: node.js twitter-bootstrap apache google-chrome woff


【解决方案1】:

仔细检查@font-face 位置路径以及mime 类型。

【讨论】:

  • 我正在使用这个确切的路径:/public/css/fonts/glyphicons-halflings-regular.woff
  • 你能发布你的 webpack.config.js。
  • @MarcusH css 应该放在哪里?
  • 我不确定我有没有,项目创建者正在使用一种叫做“gulp”的东西,这是你需要的吗?
  • css位于“style.css”中,所有文件都是scss文件,这对我来说也是全新的:)
猜你喜欢
  • 2018-05-29
  • 2017-01-10
  • 1970-01-01
  • 2015-03-31
  • 1970-01-01
  • 2016-04-09
  • 1970-01-01
  • 2014-04-30
  • 2013-08-27
相关资源
最近更新 更多