2014-05-14 75 views
2

不加载在我的CSS样式表,第一项是字体在IE 9

@font-face { 
    font-family: "Font"; 
    src: url(link) format("truetype"); 
} 
p.customfont { 
    font-family: "Font", Verdana, Tahoma; 
} 

这不是计算机上通常安装的字体。 Chrome会加载此字体并将其用于正确的位置,但IE 9不会。现在很多人仍在使用IE,这让我很担心。我尝试了很多其他电脑,并且Chrome在所有方面都工作得很好,但IE也没有成功。

我该如何解决这个问题?

编辑:以供将来参考 - http://everythingfonts.com/font-face转换为所需要的所有格式的TTF为你,并创建CSS - 所以大量的时间节省

+1

有http://www.fontspring.com/blog/fixing-ie9-font-face-problems –

+0

“很多人还在用IE” 读 - 你说就像IE是一个垂死的品种。 –

+0

使用'eot'和'woff'文件格式!你可以使用在线转换器。 –

回答

3

一般来说,你应该使用EOT,WOFF,TTF和SVG,以支持所有浏览器。

例子:

@font-face { 
font-family: 'font'; 
src: url('../fonts/font.eot'); /* IE9 Compat Modes */ 
src: url('../fonts/font.eot') format('embedded-opentype'), /* IE6-IE8 */ 
    url('../fonts/font.woff') format('woff'), /* Modern Browsers */ 
    url('../fonts/font.ttf') format('truetype'), /* Safari, Android, iOS */ 
    url('../fonts/font.svg#PlanerRegular') format('svg'); /* Legacy iOS */ 
}