How we can use @font-face in Less

后端 未结 3 1063
渐次进展
渐次进展 2020-12-15 03:05

In Less, it seems almost impossible to use @font-face selector. Less gives errors when I try to use

font-family: my_font

Her

3条回答
  •  一向
    一向 (楼主)
    2020-12-15 03:31

    I think it's because you are missing the font format. Which for ttf is truetype, if it's missing or incorrect the font might not be loaded.

    @font-face {
      font-family: "MyFont";
      src: url("./my-font.ttf") format("truetype");
    }
    

提交回复
热议问题