CSS @ font-face在ie中不起作用

Sha*_*ane 30 html css xhtml html5 css3

我有以下CSS在Firefox中工作但不是IE.显然,字体在目录中.有什么建议?

@font-face {
    font-family: "Futura";
    src: url("../fonts/Futura_Medium_BT.eot"); /* IE */
    src: local("Futura"), url( "../fonts/Futura_Medium_BT.ttf" ) format("truetype"); /* non-IE */  
}

body nav {
    font-family: Futura,  Verdana, Arial, sans-serif;
    font-size:1.2em;
    height: 40px;
}
Run Code Online (Sandbox Code Playgroud)

JD *_*cks 11

我阅读了很多暗示黑客的教程,所以我想出了这个解决方案,我觉得更好......看起来工作正常.

@font-face { 
    font-family: MyFont; src: url('myfont.ttf'); 
}
@font-face{ 
    font-family: MyFont_IE; src: url('myfont.eot'); 
}
.my_font{ 
    font-family: MyFont, MyFont_IE, Arial, Helvetica, sans-serif; 
}
Run Code Online (Sandbox Code Playgroud)

  • 这不应该是你完成这项工作的方式.尝试正确的语法:[Fontspring Syntax](http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax),[进一步加强防弹语法](http:// www. fontspring.com/blog/further-hardening-of-the-bulletproof-syntax),[Mo'防弹装置](http://readableweb.com/mo-bulletproofer-font-face-css-syntax/),或[笑脸] ](http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax). (2认同)

Aar*_*ber 10

如果你仍然遇到麻烦,这是你的解决方案:

http://www.fontsquirrel.com/fontface/generator

它比任何其他字体生成器工作得更好/更快,并且还提供了一个使用示例.


GvS*_*GvS 1

您可以使用Google Font API。他们说它适用于 IE 6 及更高版本。(我没有测试过这个。)

\n\n
\n

Google\xe2\x80\x99s 服务基础架构负责将字体转换为与任何现代浏览器(包括 Internet Explorer 6 及更高版本)兼容的格式,...

\n
\n