开发者

css font issue in internet explorer

I am using following code in CSS to render fonts, but it is not work开发者_StackOverflow社区ing in IE

@font-face{font-family: BELOVED; src: url('font/BELOVED.TTF');}

any suggestions?


IE unfortunately does not support TTF fonts, so you will need to use an EOT as well, supported types/browsers are

  • Internet Explorer (all versions): EOT
  • Safari (3.2+): TTF / OTF
  • iPhone (3.1) SVG
  • Chrome (all versions): SVG (TTF/OTF added 25th Jan 2010)
  • Firefox (3.5+): TTF/OTF (.WOFF added 3.6)
  • Opera (10+) TTF/OTF

I've had limited success with font-face, but I hope that helps.


you're better off going to fontsquirrel.com and whipping up an @font-face kit so you get maximum cross-browser. paul irish also has a slick bulletproof cross-browser example of how to embed @font-face correctly.


IE does not support TTF file format (updated March 2016).

Here is a tool to convert your TTF into EOT.


it is easy to solve by go to this link http://www.fontsquirrel.com/fontface/generator

upload your font

then download all files have different font formats which is supported for different browsers and use in your project. now it will work accurately in all browsers


The bad news: IE doesn't support standard fonts in TTF format. (I'm constantly amazed how difficult IE is to work with)

The good news: IE does support an alternative font format called EOT. You'll need to provide the font in both formats and amend your CSS to specify them both.

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

In general, you should be able to convert your TTF fonts to EOT format without too many problems, but you may find some fonts are unconvertable. In that case, you're out of luck.

More details here: http://randsco.com/index.php/2009/07/04/p680

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜