新博客:程序员小Ghttp://www.gloryofme.cn
初次使用bootstrap,使用bootstrap上传控件,遇到控件的“Browser”按钮前的文件夹图片不显示的问题。
f12查看console发现出现如下的错误:
/css/fonts/glyphicons-halflings-regular.woff2 Failed to load resource: the server responded with a status of 404 (Not Found)
/css/fonts/glyphicons-halflings-regular.woff Failed to load resource: the server responded with a status of 404 (Not Found)
/css/fonts/glyphicons-halflings-regular.ttf Failed to load resource: the server responded with a status of 404 (Not Found)
解决方案:
在对应的文件路径下发现确实缺少这几个文件
在bootstrap.min.css中有对这些字体文件的引用:
@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')}
需要找到这些文件,放到对应的路径下即可解决问题。
之前发现使用例子中的
<link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
是不会出现问题的,那么就从 http://cdn.bootcss.com/bootstrap/3.3.6/fonts 目录下找到相应的文件即可。
文件列表:
1. glyphicons-halflings-regular.eot
2. glyphicons-halflings-regular.woff2
3. glyphicons-halflings-regular.woff
4. glyphicons-halflings-regular.ttf
5. glyphicons-halflings-regular.svg
文件拷贝到对应路径,问题解决。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。