html - Html 不读取字体
问题描述
我为我的项目准备了字体。Museo Sans 有 5 种不同的重量。我需要使用@font-face 并在我的网站中使用它们。
@font-face {
font-family: "Museo Sans 100";
src: url('/app/fonts/museosans-100-webfont.ttf') format('opentype');
font-weight: 100;
}
@font-face {
font-family: "Museo Sans 300";
src: url('/app/fonts/museosans-300-webfont.ttf') format('opentype');
font-weight: 300;
}
@font-face {
font-family: "Museo Sans 500";
src: url('/app/fonts/museosans-500-webfont.ttf') format('opentype');
font-weight: 500;
}
@font-face {
font-family: "Museo Sans 700";
src: url('/app/fonts/museosans-700-webfont.ttf') format('opentype');
font-weight: 700;
}
@font-face {
font-family: "Museo Sans 900";
src: url('/app/fonts/museosans-900-webfont.ttf') format('opentype');
font-weight: 900;
}
//Font Variables
//-----
$font: 'Museo Sans 100';
@import '../utilities/fonts';
html {
font-family: $font;
}
.wrapper {
margin: 0 auto;
max-width: 1644px;
padding: 0 14.024390243%;
width: 100%;
}
当我在我的 scss 中调用它时,我可以在检查我的 html 时看到它,但字体保持不变.. 没有任何反应。有什么意见吗?PS我得到的字体都是ttf。
这是我得到的错误:
museosans-100-webfont.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
解决方案
推荐阅读
- c++ - 使用 Qt 15.3.1 进行远程调试时无法加载 qtcreatorcdbext.dll
- azure - Microsoft Azure - 制作 FTP 用户凭据时无法满足密码要求
- r - 如何在不使用 memory.size 和 memory.limit 的情况下解决“错误:无法分配大小为 XX 的向量”
- python - 如何将文本文件中的值解析为列表,同时用无填充缺失值?
- ruby-on-rails - NoMethodError(未定义的方法 `route=' for #
- javascript - Javascript 循环问题:嵌套数组访问 json 层次结构
- python-3.x - 使用列中的字符串值将行添加到数据框
- python - Librosa 无法从 BytesIO 加载
- reactjs - 如何在 React Native 中使用屏幕并为 Web 版本添加额外的路径
- c - C 菜单系统 - 开关未触发