2013-03-15 72 views
0

问题,这是我的样式表的顶部:自定义字体是具有IE

@font-face { 
    font-family: 'Open Sans'; 
    font-style: normal; 
    font-weight: 400; 
    src: local('Open Sans'), local('OpenSans'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); 
} 
body{ 
    font-family:"Open Sans"; 
    background-image:url(images/greyFadeBG.jpg); 
    background-repeat:repeat-x; 
    background-color:#ffffff; 
    margin:0px; 
    padding:0px; 
    height:100%; 
    min-width:870px; 
    font-size:14px; 
    color:#666666; 
} 

,如果我改变从FONT-FAMILY线显示在IE(9,10) 自定义字体:“打开SANS“; to font-family:“Open Sans”,sans-serif;

自定义字体将显示在IE7中,但所有IE版本都将显示san-serif字体。

@font-face { 
    font-family: 'open_sansregular'; 
    src: url('opensans-regular-webfont.eot'); 
    src: url('opensans-regular-webfont.eot?#iefix') format('embedded-opentype'), 
     url('opensans-regular-webfont.woff') format('woff'), 
     url('opensans-regular-webfont.ttf') format('truetype'), 
     url('opensans-regular-webfont.svg#open_sansregular') format('svg'); 
    font-weight: normal; 
    font-style: normal; 

} 

任何想法:

我没有运气尝试这种从字体松鼠?

+0

'@字体face'不支持IE8和较低,IE9 +仅支持可扩展的开放式(.eot)字体。 – 2013-03-15 21:34:35

+0

@ jimjimmy1995,IE是第一款支持“@ font-face”(版本5.5)的浏览器,并且IE 9增加了对EOT以外格式的支持;请参阅http://caniuse.com/fontface – 2013-03-15 22:27:41

+0

那么问题是什么? IE 9支持WOFF格式,IE 8不支持。要使可下载的字体(“自定义字体”)在所有浏览器上都可用,请使用FontSquirrel代码中所示的其他字体格式。但是,自然你必须使用相同的字体名称,就像'body'或其他元素的'font-family'声明一样。你应该解释你是如何尝试FontSquirrel的方式(演示的完整代码)。 – 2013-03-15 22:35:07

回答

0

第二@font-face工作,你需要对身体FONT-FAMILY改变

body{ 
    font-family: "open_sansregular"; 
} 

或更好,但

body{ 
    font-family: "Open Sans", "open_sansregular", sans-serif; 
} 
+0

这有帮助!我只需要在最后添加sans-serif来使其工作:font-family:“Open Sans”,“open_sansregular”,sans-serif; – TKink 2013-03-15 21:44:41