Bootstrap glyphicons-halflings-regular.woff2 Not found

博客程序员小G

icon-default.png?t=M7J4

http://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

文件拷贝到对应路径,问题解决

相关文章

显卡天梯图2024最新版,显卡是电脑进行图形处理的重要设备,...
初始化电脑时出现问题怎么办,可以使用win系统的安装介质,连...
todesk远程开机怎么设置,两台电脑要在同一局域网内,然后需...
油猴谷歌插件怎么安装,可以通过谷歌应用商店进行安装,需要...
虚拟内存这个名词想必很多人都听说过,我们在使用电脑的时候...