我的某个网站的font-squirell生成的@ font-face代码有问题。该字体不会显示在Internet Explorer 7中。对于其他浏览器,它可以很好地工作。 地址是:http://www.mrsherskin.com
@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; }
这很奇怪,因为我使用这种方法制作了另一个网站,并且效果很好。
请帮忙吗?可能是什么问题?
答案 0 :(得分: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 :(得分:3)
如果它适用于IE9而不是IE7 / 8,则其中一个问题可能是eot格式不正确。我用"Fontsquirrel, @font-face generator Expert Mode"修复了它。检查“保护:WebOnly”
答案 2 :(得分: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