为什么@ font-face在safari上有效而不在Firefox上有效? (Mac版本) [英] why does @font-face work on safari and not on firefox? (Mac versions)

查看:202
本文介绍了为什么@ font-face在safari上有效而不在Firefox上有效? (Mac版本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网站的CSS文件中使用了以下内容.它适用于Safari,但不适用于Firefox.我是一个新手,如果这是一个简单的问题,请您为此道歉.现在已经尝试了3个小时.

I've used the following in the CSS file of the website. It works on safari but not on Firefox. I'm a newbie so apologies for this if it seems like a simple question. Been trying now for 3 hours.

@ font-face { 字体家族:手写; src:url( http://example.com/handwriting.ttf ); }

@font-face { font-family: handwriting; src: url(http://example.com/handwriting.ttf); }

谢谢.

推荐答案

除非使用

Firefox prevents the loading of fonts served from a different domain unless they are sent with HTTP access control headers.

Use relative paths if you are serving the font from the same domain. If handwriting.ttf was in the same directory as your css file then you would use this:

@font-face { font-family: handwriting; src: url(handwriting.ttf); }

这篇关于为什么@ font-face在safari上有效而不在Firefox上有效? (Mac版本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆