css - @font-face 在 IE7 中不工作

标签 css internet-explorer-7 font-face

我正在尝试所有这些不同的方式:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>

    <style type="text/css">
    @font-face {
        font-family: "cursivas";
        src: url(Freestyle.ttf) format("truetype");
    }
    @font-face {
        font-family: "tabs";
        src: url(FrutigerLTStd-Bold.otf) format("truetype");
    }
    @font-face {
        font-family: 'topMenuFont';
        src: url('frutigerltstd-bold-webfont.eot');
        src: url('frutigerltstd-bold-webfont.eot?#iefix') format('embedded-opentype'),
             url('frutigerltstd-bold-webfont.woff') format('woff'),
             url('frutigerltstd-bold-webfont.ttf') format('truetype'),
             url('frutigerltstd-bold-webfont.svg#FrutigerLTStd65Bold') format('svg');
        font-weight: normal;
        font-style: normal;
    }
    p.customfont { 
        font-family: "cursivas";

    }
    p.tabs{
        font-family:'tabs';color:#8e8e8e;
    }
    p.menu{
        font-family:'topMenuFont';
    }
    p{
    font-size:30px;
        color:#8e8e8e;
    }
    </style>
    </head>
    <body>

    <p class="customfont">FAMILIAS  <span style="color:blue">RESERVAS</span></p>
    <p class="tabs">FAMILIAS  <span style="color:blue">RESERVAS</span></p>
    <p class="menu">FAMILIAS <span style="color:blue">RESERVAS</span></p>
    <p>FAMILIAS <span style="color:blue">RESERVAS</span></p>
    </body>

</html>

路径没问题,因为它们都在 FF 中工作,

知道我错过了什么吗?

最佳答案

尝试描述的语法 here :

@font-face {
font-family: 'MyFontFamily';
src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'), 
     url('myfont-webfont.woff') format('woff'), 
     url('myfont-webfont.ttf')  format('truetype'),
     url('myfont-webfont.svg#svgFontName') format('svg');
}

从 fontsquirrel.com 获得链接,他们将它用于所有生成的字体。您还可以查看 Google Web Font生成 css (它只显示您使用的浏览器的字体)

并将其加载到外部 css 文件中,这也可能会解决一些问题。

关于css - @font-face 在 IE7 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7888146/

相关文章:

php - 为什么 'float' 属性在 IE7 上不起作用?

Facebook JavaScript SDK FB.Canvas.setSize 和 setAutoGrow 在 IE7/8 中不起作用

gwt - 在Gwt中,如何使复选框的文本变为粗体?

javascript - 在不修改当前代码的情况下使用javascript上传多个文件

css - fontawesome 字体 compass 生成错误

javascript - React 背景图像样式不适用于本地镜像

firefox - icoMoon 字体在 Firefox 上不显示

css - React css-loader style-loader IF 语句

javascript - 在IE7中停止Youtube播放器(使用Rob W解决方案)

css - 字体和 Wordpress : Font not showing some UTF-8 characters it should support