# 字体样式和iconfont的应用

# 使用自定义字体

  • 注意版权问题
  • 首先定义字体
  @font-face {
    font-family: 'selfFamily'; /* 名字任意取 */
    src: url('selfFont.woff2') format('woff2'),
         url('selfFont.woff') format('woff'),
         url('selfFont.ttf') format('truetype');
    font-style:normal;
    font-weight:normal;
  }
1
2
3
4
5
6
7
8
  • 使用字体
  .use-family{
    font-family:'selfFamily' /* @font-face 中 font-family 定义的名字 */
  }
1
2
3

# 相关资料

Last Updated: 1/23/2022, 10:16:22 AM