Use multiple custom fonts using @font-face?

前端 未结 5 1855
别那么骄傲
别那么骄傲 2021-01-31 01:07

I\'m sure I\'m missing something really straight forward. Been using a single custom font with normal font face:

@font-fa         


        
5条回答
  •  [愿得一人]
    2021-01-31 01:43

    You simply add another @font-face rule:

    @font-face {
        font-family: CustomFont;
        src: url('CustomFont.ttf');
    }
    
    @font-face {
        font-family: CustomFont2;
        src: url('CustomFont2.ttf');
    }
    

    If your second font still doesn't work, make sure you're spelling its typeface name and its file name correctly, your browser caches are behaving, your OS isn't messing around with a font of the same name, etc.

提交回复
热议问题