首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Bootstrap 3.3.4 Glyphicons不工作?

Bootstrap 3.3.4 Glyphicons不工作?
EN

Stack Overflow用户
提问于 2015-05-01 23:01:34
回答 2查看 1.8K关注 0票数 2

我最近一直在尝试让Glyphicons工作,但没有成功。我使用的JSF框架的文件结构如下。

我还修改了bootstrap.css中的CSS,删除了(..)从下面的CSS代码中的每个路径变成这样:

代码语言:javascript
复制
@font-face {
  font-family: 'Glyphicons Halflings';

  src: url('/fonts/glyphicons-halflings-regular.eot');
  src: url('/fonts/glyphicons-halflings-regular.eot?#iefix')    format('embedded-opentype'), url('/fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('/fonts/glyphicons-halflings-regular.woff') format('woff'), url('/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
   }  

当不删除(..)时,JSF将显示以下两个警告:

代码语言:javascript
复制
Warning:   JSF1091: No mime type could be found for file css/lib/fonts/glyphicons-halflings-regular.woff2.  To resolve this, add a mime-type mapping to the applications web.xml.
Warning:   JSF1064: Unable to find or serve resource, css/lib/fonts/glyphicons-halflings-regular.woff2.  

但仍然总是给我看一个奇怪的盒子,而不是应该出现的Glyphicon?

请帮帮忙..

EN

回答 2

Stack Overflow用户

发布于 2015-05-02 02:15:01

我通过使用以下表达式正确引用资源找到了解决方案:

代码语言:javascript
复制
@font-face {

  font-family: 'Glyphicons Halflings';

  src: url("#{resource['default/1_0/fonts/glyphicons-halflings-regular.eot']}");
  src: url("#{resource['default/1_0/fonts/glyphicons-halflings-regular.eot']}") format('embedded-opentype'), url("#{resource['default/1_0/fonts/glyphicons-halflings-regular.woff2']}") format('woff2'), url("#{resource['default/1_0/fonts/glyphicons-halflings-regular.woff']}") format('woff'), url("#{resource['default/1_0/fonts/glyphicons-halflings-regular.ttf']}") format('truetype'), url("#{resource['default/1_0/fonts/glyphicons-halflings-regular.svg']}") format('svg');

     }
票数 0
EN

Stack Overflow用户

发布于 2015-05-24 00:04:19

问题出在fonts文件夹。

将你的fonts文件夹替换为:https://github.com/twbs/bootstrap中的文件夹,它会工作得很好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29989355

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档