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 ...
随机推荐
- HOWTO Install the MinGW (GCC) Compiler Suite
Posted July 25th, 2008 by mingwadmin getting started install mingw Automated Installer If you are ne ...
- HGE游戏引擎之hgeQuad结构体的使用(用于渲染图片)
HGE基本的渲染图元是hgeQuad (Quad is the basic HGE graphic primitive),其中有一个hgeVertex成员结构,它用来描述图元顶点信息.The hgeV ...
- OpenStack 镜像制作
Contents [hide] 1 Centos6.5 img制作 1.1 基础环境安装 1.2 下载或从本地上传系统镜像 1.3 启动服务 1.4 建立镜像文件 1.5 通过virt-install ...
- 坑爹的VS2012
2.2.2.如果卸载 Visual Studio 2010 Service Pack 1,则必须先重新安装 Visual Studio 2010,然后才能再次安装 SP1 如果卸载 Visual St ...
- 6、XML(2)
1 总结XML基础 XML基础 1)XML的作用 1.1 作为软件配置文件 1.2 作为小型的"数据库" 2)XML语法(由w3c组织规定的) 标签: 标签名不能以数字开头,中间不 ...
- ios tabbar 文字位置
[nav.tabBarItem setTitlePositionAdjustment)];
- mongo VUE 操作
一 修改字段名称 db.rc_配置_付款限额_消费.update({ "生效标识" : 1, "$atomic" : "true" },{ ...
- 使用pt-heartbeat检测主从复制延迟
不要用SECONDS_BEHIND_MASTER来衡量MYSQL主备的延迟时间,原因如下: A:备库Seconds_behand_master值是通过将服务器当前的时间戳与二进制日志中的事件的时间戳对 ...
- Android 5.1 - 状态栏充电标志问题
Android 5.1 Ubuntu14.04 SourceInsigh 电量已满,插着USB头,观察Settings - Battery,电量为100%,状态为full,但仍有充电图标rust 之 ...
- Android开发:ScrollView嵌套GridView的解决办法
Android开发:ScrollView嵌套GridView的解决办法 前些日子在开发中用到了需要ScrollView嵌套GridView的情况,由于这两款控件都自带滚动条,当他们碰到一起的时候便 ...