Font Awesome fonts show up as boxes on IE8

后端 未结 10 1712
[愿得一人]
[愿得一人] 2020-12-05 05:01

So I am using Font Awesome in a project and in testing I\'m running into issues with IE8.

On Windows IE9, Chrome and Firefox show the font properly (As does Firefox,

10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 05:33

    I had the same problem and found a solution, I'll post it here in case anyone still needs it.

    The problem was that IE failed to load the font files, it was constructing weird GET requests that returned 404 errors.

    Using the trick found here: http://www.fontspring.com/blog/fixing-ie9-font-face-problems I was able to fix the issue.

    Add ?#iefix to the eot url in the CSS that contains the font-face (in this case font-awesome.css)

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

提交回复
热议问题