@font-face fonts not working

前端 未结 2 1719
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-26 13:21

I\'m trying to get a font working from local storage.

@font-face {
    font-family: const;
    src: url(const.ttf);
}

.fp_title1 {
    font-family: \'const\', t         


        
相关标签:
2条回答
  • 2021-01-26 13:29

    You might have 2 mistakes in code: path and extention. And use the following formats as well as ttf:

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

    urls that helps to create web fonts:

    http://www.fontsquirrel.com/tools/webfont-generator

    http://www.font-face-generator.com/

    0 讨论(0)
  • 2021-01-26 13:35

    CSS has a .css filename extension, you gave it .ttf

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