2012-01-19 34 views
15

我正在尝试在我正在使用的网站上使用绿色枕头和Cotidiana字体。我已经加载使用@字体面的.eot文件,但它仍然没有工作...我的自定义字体不想在Internet Explorer中工作

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

@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 */ 
} 
+12

***叹息*** ......如果每次我对自己说的话,只有我有一个$$$,*“哎呀,这可以在每个浏览器中使用,但Internet Explorer。”* – rdlowrey

+0

您是否听说过的Cufón?值得一看:http://cufon.shoqolate.com/generate/ – Magrangs

+0

那么应该工作,你用什么来转换字体? –

回答

25

你可以尝试下面的语法,被称为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版本的字体,只需删除这些行。

+2

非常感谢,解决了这个问题。恼人的是,微软的字体渲染是如此糟糕,但啊。 – sanjaypoyzer

+0

我已经有了这个答案中描述的代码,但是在IE中它仍然没有工作。我发现F5-ing和加载不同页面的组合是IE需要共同行动的。 – KSwift87