@fontface适用于http://www.domain.com,但不适用于http://domain.com [英] @fontface works on http://www.domain.com but doesn't work on http://domain.com
本文介绍了@fontface适用于http://www.domain.com,但不适用于http://domain.com的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
@fontface
可在我载入 http://www.grozav时使用.com ,但不适用于 http://grozav.com 。
@fontface
works when I load http://www.grozav.com but doesn't work on http://grozav.com .
如何解决这个问题?
@font-face {
font-family: Impact;
font-weight:bold;
src: url('http://grozav.com/font/impact.ttf');
src: url('http://www.grozav.com/font/impact.ttf');}
@font-face {
font-family: MisterGiacco-Bold;
font-weight:bold;
src: url('http://grozav.com/font/giacco.ttf');
src: url('http://www.grozav.com/font/giacco.ttf');}
我试着放2个网址。没有工作。有人可以帮我解决这个问题吗?
I tried putting 2 urls. Didn't work. Can someone help me with this?
推荐答案
为什么要指定完整的网址?只需输入:
Why specify the full URL? Just put:
src: url('/font/giacco.ttf');
这可能是 @fontface
不工作跨域。 FireFox有这个问题。
It might be a case that @fontface
doesn't work cross-domain. FireFox has an issue with this.
但是如果你使用的文件来自同一个域,只是不指定完整的域,只是提供路径到ttf文件。
But if you are using a file from within the same domain, just don't specify the full domain, and just the supply the path to the ttf file.
这篇关于@fontface适用于http://www.domain.com,但不适用于http://domain.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文