字体文件无法加载,确认文件是存在的

发布于 7 年前作者 phe11404 次浏览最后编辑 7 年前来自 ask

@font-face {

  font-family: ‘Glyphicons Halflings’;

  src: url(‘/assets/fonts/glyphicons-halflings-regular.eot’);

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

}

控制台报错

VM884:2 Failed to load font http://1701630871.debug.open.weixin.qq.com/assets/fonts/glyphicons-halflings-regular.woff : the server responded with a status of 404 (HTTP/1.1 404 Not Found) 

From server 127.0.0.1

文件确实存在的,其他jpg/png图片文件都没问题

是bug,还是限制了这些文件类型?

7 回复
cqian
cqian1 楼6 年前

通过网络加载果然可以了。

request域名一个月设置三次,一下子用完了 -_-

ccao
ccao2 楼6 年前

请问各位大神,我字体使用网络地址之后,ios和模拟器上是可以正常显示了,但是安卓机器上缺不生效,这是为啥?

guiyinglai
guiyinglai3 楼6 年前

字体文件要放在网络上请求。

uyu
uyu4 楼6 年前

好的,谢谢两位,我试试看。

yongren
yongren5 楼6 年前

可以放到本地的。

qianglu
qianglu6 楼6 年前

我的字体也是在ios上有效,安卓真机上无效,请问是为什么?

junhe
junhe7 楼5 年前

无法加载本地的,需要用网络地址