@fontface works on http://www.domain.com but doesn't work on http://domain.com

前端 未结 2 1935
旧时难觅i
旧时难觅i 2021-01-25 08:16

@fontface works when I load http://www.grozav.com but doesn\'t work on http://grozav.com .

What can I do to fix this?

 @font-face {
    fon         


        
相关标签:
2条回答
  • 2021-01-25 08:53

    Definitively it's the url, but why? Apparently @font-face does not care about cross domain issues but firefox do, so in order to make it work with cross domain in firefox you should set your server (apache?) to avoid this restriction for one or multiple domains, the following page has some info about this: http://www.cssbakery.com/2010/07/fixing-firefox-font-face-cross-domain_25.html

    I guess the simplest choice is @Curt's choice ;)

    0 讨论(0)
  • 2021-01-25 08:59

    Why specify the full URL? Just put:

    src: url('/font/giacco.ttf');
    

    It might be a case that @fontface doesn't work cross-domain. FireFox has an issue with this.

    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.

    0 讨论(0)
提交回复
热议问题