glyphicons-halflings-regular.ttf 404
这个是用bootstrap框架时我遇到的问题,个人解决过程如下:
① 这个资源不是我手动引用的,是bootstrap.min.css文件间接调用的。
② 默认的路径是css文件路径是project/css,引用的路径是project/fonts/*.ttf。
③ 添加fonts文件夹和文件,依然提示该错误,但是直接访问*.css文件就没问题。
④ 想起静态资源的调用是通过tomcat手动配置的。
⑤ 增加这些文件的匹配规则,在web.xml中增加如下配置:
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.ttf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.woff</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.woff2</url-pattern>
</servlet-mapping>
⑥ OK,测试通过。
不想使用默认的文件路径怎么办?
⑦ 修改bootstrap.css关于ttf等资源调用的路径信息:
@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');
}
将fonts文件夹改成你实际的资源路径,然后引用bootstrap.css。
⑧ 这时发现bootstrap.css需要用到bootstrap.css.map文件。具体关系和原理尚需继续学习。
glyphicons-halflings-regular.ttf 404的更多相关文章
- glyphicon halflings regular ttf 报错
一个web项目 用了bootstrap chrome开f12报错提示glyphicon halflings regular ttf找不到 为什么找不到,肯定又是path出了问题 找到bootstrap ...
- Python3.4+Django1.9+Bootstrap3
实现和原理 Python集成Django开发框架后,可以通过在cmd命令提示符下建立工程,工程名为learn_models 1 django-admin.py startproject learn_m ...
- Bootstrap<基础十一>字体图标(Glyphicons)
字体图标(Glyphicons),并通过一些实例了解它的使用.Bootstrap 捆绑了 200 多种字体格式的字形. 获取字体图标 我们已经在 环境安装 章节下载了 Bootstrap 3.x 版本 ...
- Bootstrap中glyphicons-halflings-regular.woff字体报404错notfound
今天查看网站的源代码,发现有个glyphicons-halflings-regular.woff文件没有找到,因为我的网站使用了bootstrap的Glyphicons 字体图标,因此需要加载Glyp ...
- Bootstrap 字体图标(Glyphicons)
http://www.runoob.com/bootstrap/bootstrap-glyphicons.html 什么是字体图标? 字体图标是在 Web 项目中使用的图标字体.虽然,Glyphico ...
- Bootstrap-CL:字体图标(Glyphicons)
ylbtech-Bootstrap-CL:字体图标(Glyphicons) 1.返回顶部 1. Bootstrap 字体图标(Glyphicons) 本章将讲解字体图标(Glyphicons),并通过 ...
- Bootstrap 3 Glyphicons are not working
Bootstrap 3 Glyphicons are not working 解答1 Note to readers: be sure to read @user2261073's comment a ...
- Bootstrap3 为何无法显示Glyphicons 图标
Bootstrap3 为何无法显示Glyphicons 图标 在CSS引入字体即可解决 @font-face { font-family: 'Glyphicons Halflings'; src: u ...
- (转)Bootstrap中glyphicons-halflings-regular.woff字体报404错notfound
http://blog.xmaoseo.com/glyphicons-halflings-regular-woff-font-404-notfound/ 今天查看网站的源代码,发现有个glyphico ...
随机推荐
- zw版【转发·台湾nvp系列Delphi例程】HALCON Cast 使用方式
zw版[转发·台湾nvp系列Delphi例程]HALCON Cast 使用方式 procedure TForm1.Button1Click(Sender: TObject);var img, img1 ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON SetLineStyle1
zw版[转发·台湾nvp系列Delphi例程]HALCON SetLineStyle1 procedure TForm1.Button1Click(Sender: TObject);var img : ...
- AndroidUI自动化测试工具-UIautomator
转自:http://www.cnblogs.com/rexmzk/archive/2012/12/26/2834380.html 最近公司在开展Android的自动化测试,美国那边的开发人员利用And ...
- android 学习随笔一(配置调试与基础)
一.基础与开发环境安装配置 Memory Options: VM Heap表示每个应用所能占用的最大内存. Android 项目目录结构 SRC java源码 android.jar 导入jar才能使 ...
- JAVA学习方法
我觉得要想学好的话,首先,你得会用,能玩的起来,然后才会慢慢激发你的兴趣,它为何这么用?就这样一步一步的去探索,不断地积累,总结.编程讲究的是思维,死记硬背是没有意义的,想学好编程就一个字:敲,俩字 ...
- linux问题汇总---如何生成密钥对
准备:2台机器,ip分别为:192.168.0.195 192.168.1.210目的:通过195ssh远程访问210.无需输入密码 1.首先在195上生成密钥对.#cd /root/.ssh ...
- Google 开发新的开源系统 Fuchsia
google 最新os 下载 https://github.com/fuchsia-mirror/magenta 本文转自:http://www.oschina.net/news/76094/goog ...
- SQL Server 复制 订阅与发布
SQL Server 复制 订阅与发布 通过SQL Server 2008数据库复制实现数据库同步备份 SqlServer2008 数据库同步的两种方式(Sql JOB) SqlServer2008 ...
- Understanding the RelationshipType Enumeration [AX 2012]
Understanding the RelationshipType Enumeration [AX 2012] 3 out of 3 rated this helpful - Rate this t ...
- CGRectGet系列
CGRectGetHeight返回label本身的高度 CGRectGetMinY返回label顶部的坐标 CGRectGetMaxY 返回label底部的坐标 CGRectGetMinX 返回lab ...