Why does removing woff2 in @font-face solve IE11 problems

会有一股神秘感。 提交于 2020-01-24 05:07:12

问题


I had troubles with a @font-face these days. My font was not displaying in IE11, but in all others.

Turned out that removing the "woff2" font solved my problems and the font displayed normally.

My question now is: Why could that be the solution? What is going on in IE11s mind, that removing a simple "woff2" tag could be the answer? I mean, normally I read about .htaccess files and other things which are really not easy to find out...

Does IE11 try to load the woff2 first?


回答1:


IE 11 use woff instead of woff2. If you want maximum compatibility use this:

@font-face {
  font-family: 'MyWebFont';
  src: url('webfont.eot'); /* IE9 Compat Modes */
  src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
       url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
       url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}

For reference: CSS Tricks - Using @font-face



来源:https://stackoverflow.com/questions/40531131/why-does-removing-woff2-in-font-face-solve-ie11-problems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!