【问题标题】:@font-face problems in Internet Explorer 7Internet Explorer 7 中的@font-face 问题
【发布时间】:2012-12-14 22:13:16
【问题描述】:

我的一个网站的 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; }

这很奇怪,因为我有另一个网站是用这种方法制作的,而且效果很好。

有什么帮助吗?可能是什么问题?

【问题讨论】:

    标签: css font-face


    【解决方案1】:

    试试这个:

    @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;
    }
    

    当然,用你自己的字体替换字体,并添加一个粗体字体的声明。它应该工作;)

    【讨论】:

    • 笑脸规则!我花了很多时间:(。谢谢!
    【解决方案2】:

    如果它适用于 IE9 但不适用于 IE7/8,则问题之一可能是 eot 格式不正确。我已经用"Fontsquirrel, @font-face generator Expert Mode" 修复了它。检查“保护:WebOnly”

    【讨论】:

      【解决方案3】:

      您是否确保 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
      

      【讨论】:

      • 当我将它复制到我的 .htaccess 时,它完全破坏了网站:-((我不得不重做它的一些旧版本。
      • 这很奇怪——也许你的主机不允许这样的指令。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-21
      • 2015-05-28
      • 1970-01-01
      • 2011-04-03
      • 2011-02-19
      • 1970-01-01
      • 2015-02-01
      相关资源
      最近更新 更多