Internet Explorer 11 and supported web fonts

后端 未结 2 1598
挽巷
挽巷 2020-12-31 09:39

I\'m using a TTF and OTF web font to catch all major browsers(FireFox, Chrome and IE11) on most devices. It all looks fine, before relocation to the production server and th

相关标签:
2条回答
  • 2020-12-31 09:52

    This is the standard way of loading with @font-face, hacky fixes and all -

    @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 */
        }
    

    hey please check the Compatibility tables for support of EOT, check these links -

    Link 1

    Link 2

    0 讨论(0)
  • 2020-12-31 10:06

    Be aware of one thing:
    Fonts won't work in IE if the font-family entry in css is named differently than the font name! This bug took me all day to figure out and can be very frustrating if you are not aware of it!

    For IE 6-11, use EOT fonts, but be aware it is not supported by any other browser.

    For IE >=9 & all other browsers, use woff fonts, as it has the widest support and the best compression, since it was designed specifically for the web.

    as such:

    @font-face {
        font-family: 'FontName';
        src: url('FontName.eot');  /* IE 9 - 11 */
        src: url('FontName.eot?#iefix') format('embedded-opentype'), /* IE Fix for IE 6-8*/
             url('FontName.woff') format('woff'); /* IE 9-11 & All Modern Browsers */
    }

    0 讨论(0)
提交回复
热议问题