CSS @font-face not working with Firefox, but working with Chrome and IE

后端 未结 28 2437
野趣味
野趣味 2020-11-22 06:27

The following code works in Google Chrome beta as well as IE 7. However, Firefox seems to have a problem with this. I\'m suspecting it to be a problem of how my CSS files ar

28条回答
  •  再見小時候
    2020-11-22 06:34

    In addition to adding the following to your .htaccess: (thanks @Manuel)

    
      
        Header set Access-Control-Allow-Origin "*"
      
    
    

    You may want to try explicitly adding the webfont mime types to the .htaccess file... like this:

    AddType font/ttf .ttf
    AddType font/eot .eot
    AddType font/otf .otf
    AddType font/woff .woff
    

    In the end, my .htaccess file looks like this (for the section that enables webfonts to work in all browsers)

    # BEGIN REQUIRED FOR WEBFONTS
    
    AddType font/ttf .ttf
    AddType font/eot .eot
    AddType font/otf .otf
    AddType font/woff .woff
    
    
        
            Header set Access-Control-Allow-Origin "*"
        
    
    
    # END REQUIRED FOR WEBFONTS
    

提交回复
热议问题