特殊字体指的是默认电脑中没有的

1、下载字体

2、新建文件夹font,把字体放进去

vue项目中引入特殊字体

3、新建font.css

vue项目中引入特殊字体

4、使用@font-face设置字体

@font-face {
  font-family: 'txchj'; // txchj 我自己定义的
  src: url("~@/assets/font/txchj.ttf"); // 路径自己调整
}

5、main.js引入font.css

6、组件中就可以使用了

  .header-title{
    line-height: 75px;
    font-family: 'txchj';
    font-size: 34px;
    margin-left: 56px;
    color: #62c7e0;
    letter-spacing: 1.3px;
  }

 

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2021-08-07
猜你喜欢
  • 2021-05-18
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
相关资源
相似解决方案