我只在 Firefox 中遇到 webfonts 问题,所有其他浏览器(包括 IE)都可以正常工作。
我的问题是网络字体根本无法加载。
我看过这个可能的解决方案,编辑 htaccess 文件 ( http://www.fontsquirrel.com/blog/2010/11/troubleshooting-font-face-problems ),但我没有运气。
我唯一能说的是在 Firefox 的错误控制台中我收到以下警告:
Error in parsing value for "src". Skipped to the next declaration.
这是我的font-face
代码示例:
@font-face {
font-family:AngelinaRegular;
src:url(../fonts/angelina-webfont.eot);
src:url(../fonts/angelina-webfont.eot?iefix) format(eot), url(../fonts/angelina-webfont.woff) format(woff), url(../fonts/angelina-webfont.ttf) format(truetype), url(../fonts/angelina-webfont.svg#webfontOvuhCGpN) format(svg);
font-weight:normal;
font-style:normal;
}
有什么想法吗?
最佳答案
根据我的经验,Firefox 对在 @font-face
规则中使用引号很挑剔:
@font-face {
font-family: AngelinaRegular;
src: url('../fonts/angelina-webfont.eot');
src: url('../fonts/angelina-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/angelina-webfont.woff') format('woff'),
url('../fonts/angelina-webfont.ttf') format('truetype'),
url('../fonts/angelina-webfont.svg#webfontOvuhCGpN') format('svg');
font-weight: normal;
font-style: normal;
}
关于Firefox 网页字体未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6541885/