css - 为什么我的网站上的自定义字体不起作用
问题描述
在我添加对 .ttf、.eot 和 .svg 的支持之前,它可以工作,但现在,它不再工作了。
CSS:
@charset "UTF-8";
@font-face {
font-family: 'qianxsnjgregular';
src: url('./font/zh/qxsn-webfont.eot');
src: url('./font/zh/qxsn-webfont.eot?#iefix') format('embedded-opentype'),
url('./font/zh/qxsn-webfont.woff2') format('woff2'),
url('./font/zh/qxsn-webfont.woff') format('woff'),
url('./font/zh/qxsn-webfont.ttf') format('truetype'),
font-weight: normal;
font-style: normal;
font-display: swap;
}
body {
font-family: 'qianxsnjgregular', SimHei, sans-serif;
font-weight:normal;
font-style:normal;
}
解决方案
推荐阅读
- spring-batch - 自定义 ItemWriter 以像 CompositeWriter 一样工作以将数据写入 db 和 xml
- bash - 为什么 extglob "+(*/)A" 不像 "find -name A" 那样工作?
- android - Android UI 测试无法解析以下活动:意图
- javascript - 为 VueJS 应用程序实现 manifest.json 文件以设置条件
- powershell - 将某种类型的文件从一个文件夹移动到另一个文件夹
- java - 从 Java Arraylist 中删除
- react-native - 按钮上的 KeyboardAwareScrollView
- android - 使存储库在 Clean Architecture 的域层中不可见
- android - 是否可以避免应用程序关闭的活动?
- php - 自定义帖子查看计数器 WordPress