Font-face not working in IE, otf font

后端 未结 5 1936
鱼传尺愫
鱼传尺愫 2021-01-02 07:34

I know this was asked multiple times, but I couldn\'t get it to work after trying them. This is the simple CSS I am using to import a custom font. Also, I am using this with

5条回答
  •  太阳男子
    2021-01-02 08:08

    Internet explorer use eot format (legacy) or woff. See MSDN

    Anyway i use this code for maximum compatibility:

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

提交回复
热议问题