2011-05-10 74 views
4

我的一个网站的font-squirell生成的@ font-face代码有问题。字体不显示在Internet Explorer 7中。与其他浏览器一起使用效果很好。 地址是:http://www.mrsherskin.com@ Internet Explorer 7中的font-face问题

@font-face { 
    font-family: 'PFRondaSeven'; 
    src: url('font/pf_ronda_seven-webfont.eot'); 
    src: url('font/pf_ronda_seven-webfont.eot?iefix') format('eot'), 
     url('font/pf_ronda_seven-webfont.woff') format('woff'), 
     url('font/pf_ronda_seven-webfont.ttf') format('truetype'), 
     url('font/pf_ronda_seven-webfont.svg#webfont7vFUbybx') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 

@font-face { 
    font-family: 'PFRondaSeven'; 
    src: url('font/pf_ronda_seven_bold-webfont.eot'); 
    src: url('font/pf_ronda_seven_bold-webfont.eot?iefix') format('eot'), 
     url('font/pf_ronda_seven_bold-webfont.woff') format('woff'), 
     url('font/pf_ronda_seven_bold-webfont.ttf') format('truetype'), 
     url('font/pf_ronda_seven_bold-webfont.svg#webfont2zOjOL6G') format('svg'); 
    font-weight: bold; 
    font-style: normal; 
} 

/* basic font-set */ 

body { font-family: 'PFRondaSeven'; font-size-adjust: 0.62; } 

这很奇怪,因为我还有一个网站,我用这种方法制成,它完美的作品。

请帮忙吗?可能是什么问题呢?

回答

4

试试这个:

@font-face { 
font-family: 'Avenir'; 
src: url('avenirl8-webfont.eot'); 
src: local('☺'), url('avenirl8-webfont.woff') format('woff'), url('avenirl8-webfont.ttf') format('truetype'), url('avenirl8-webfont.svg#webfontIFZXxqn6') format('svg'); 
font-weight: normal; 
font-style: normal; 
} 

用自己的课程更换字体和添加的字体为粗体的声明了。它应该工作;)

+1

谢谢,笑脸解决了问题:-)! 最好的问候,煤气 – Gas 2011-05-10 18:10:43

+0

@煤气没问题;) – Krimo 2011-05-11 06:41:42

+0

笑脸规则!我花了这么多时间:(。谢谢! – Arvid 2011-10-30 11:44:40

0

你确定eot文件有正确的mimetype?

我通常将它添加到我的.htaccess文件(或等同于不同的软件)

AddType application/vnd.ms-fontobject eot 
AddType font/ttf      ttf 
AddType font/otf      otf 
AddType font/x-woff     woff 

AddType text/x-component .htc 
+0

当我将这个复制到我的.htaccess中时,它会破坏网站: - ((我不得不重做一些旧版本的 – Gas 2011-05-10 11:35:41

+0

这很奇怪 - 也许你的主机不允许这样的指令。 – 2011-05-10 12:31:10

3

如果它的工作原理IE9但不是IE7/8,这个问题的一个可能是EOT的格式不正确。我用"Fontsquirrel, @font-face generator Expert Mode"修复了它。检查“保护:WebOnly”

+0

这一个肯定为我工作,谢谢。 – Rich 2013-07-08 06:46:45