我的自定义字体不想在Internet Explorer中工作 [英] My custom font doesn't want to work in Internet Explorer

查看:149
本文介绍了我的自定义字体不想在Internet Explorer中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我正在处理的网站上使用Green Pillow和Cotidiana字体。我使用@ font-face加载了.eot文件,但它仍然不工作...

I'm trying to use the Green Pillow and Cotidiana fonts on a site I'm working on. I've loaded the .eot file using @font-face but it's still not working...

真的不知道我在这里做了什么错误:

Really not sure what I've done wrong here:

@font-face {  
 font-family: "link_font";  
 src: url( "Greenpiloww.eot" ); /* IE */  
 src: local("GreenPillow"), url( "GREENPIL.otf" ) format("truetype"); /* non-IE */  
}  


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


推荐答案

您可以尝试以下语法,称为防弹字体表面语法

You might try the following syntax, known as the bulletproof font-face syntax:

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

显然, .eot 字体有助于IE不窒息。如果您没有.svg或.woff版本的字体,只需删除这些行。

Apparently the querystring after the .eot font helps IE not choke. If you don't have .svg or .woff versions of your fonts, just remove those lines.

这篇关于我的自定义字体不想在Internet Explorer中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆