首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >为什么@ font-face在woff文件上抛出404错误?

为什么@ font-face在woff文件上抛出404错误?

提问于 2017-12-22 16:47:26
回答 2关注 0查看 842

我正在使用@font-face我公司的网站,它的工作/看起来不错。除了Firefox和Chrome会在.woff文件上引发404错误。IE不会抛出错误。我有位于根目录的字体,但我已经尝试了在CSS文件夹中的字体,甚至给整个网址的字体。如果从我的CSS文件中删除这些字体,我不会得到一个404,所以我知道这不是一个语法错误。

另外,我使用fontsquirrels工具来创建@font-face字体和代码:

@font-face {
  font-family: 'LaurenCBrownRegular';
  src: url('/laurencb-webfont.eot');
  src: local('☺'), 
    url('/laurencb-webfont.woff') format('woff'), 
    url('/laurencb-webfont.ttf') format('truetype'), 
    url('/laurencb-webfont.svg#webfontaaFhOfws') format('svg');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'FontinSansRegular';
  src: url('/fontin_sans_r_45b-webfont.eot');
  src: local('☺'), 
    url('/fontin_sans_r_45b-webfont.woff') format('woff'), 
    url('/fontin_sans_r_45b-webfont.ttf') format('truetype'), 
    url('/fontin_sans_r_45b-webfont.svg#webfontKJHTwWCi') format('svg');
  font-weight: normal;
  font-style: normal;
}
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档