@font-face ie problems

前端 未结 4 1385
猫巷女王i
猫巷女王i 2020-12-19 17:27

I have tried a few different ways to include the correct fonts in the CSS. I know that I need the eot version for the font to work on IE, but I can\'t get it to recognize i

相关标签:
4条回答
  • 2020-12-19 17:54

    This is the css I have for Bebas on our site (not Neue), but note the URL:

    @font-face {
        font-family: 'Bebas';
        src: url('../fonts/bebas-webfont.eot');
        src: url('../fonts/bebas-webfont.eot?#iefix') format('embedded-opentype'),
             url('../fonts/bebas-webfont.ttf') format('truetype'),
             url('../fonts/bebas-webfont.svg#bebasregular') format('svg');
        font-weight: normal;
        font-style: normal;
    }
    
    0 讨论(0)
  • 2020-12-19 18:06

    This code should make it work.. if not, check your font URL (if it exists).

    @font-face {
      font-family: 'BebasNeue';
      src: url('fonts/BebasNeue.eot');
      src: local('BebasNeue'), local('BebasNeue'), url('fonts/BebasNeue.eot') format('embedded-opentype');
    }
    
    0 讨论(0)
  • 2020-12-19 18:13

    Sometimes when you convert font type (other that TTF) the font doesn't work.. Try to use TTF font and convert it..

    I didn't experience that with TTF fonts.. but i did with other font types.

    0 讨论(0)
  • 2020-12-19 18:16

    You need to set Access-Control-Allow-Origin HTTP Header for this
    See here:
    IE9 blocks download of cross-origin web font


    Does this work?

    @font-face {
        font-family: 'BebasNeue';
        src: url('fonts/BebasNeue.eot');
        src: url('fonts/BebasNeue.eot?#iefix') format('embedded-opentype'),
             url('fonts/BebasNeue.otf') format("opentype");
    }
    

    On Fontsquirrel they do it this way
    http://www.fontsquirrel.com/fontfacedemo/bebas-neue

    Download the @font-face kit from there

    @font-face {
        font-family: 'BebasNeueRegular';
        src: url('/utils/load_demo_font.php?font=960/BebasNeue-webfont.eot');
        src: url('/utils/load_demo_font.php?font=960/BebasNeue-webfont.eot?#iefix') format('embedded-opentype'),
             url('/utils/load_demo_font.php?font=960/BebasNeue-webfont.woff') format('woff'),
             url('/utils/load_demo_font.php?font=960/BebasNeue-webfont.ttf') format('truetype'),
             url('/utils/load_demo_font.php?font=960/BebasNeue-webfont.svg#BebasNeueRegular') format('svg');
        font-weight: normal;
        font-style: normal;
    
    }
    
    0 讨论(0)
提交回复
热议问题