我为我的网站添加了字体系列文件。
@font-face {
font-family: 'FormulaCondesedLight';
src: url("./fonts/SFProDisplay.otf");
}
h1 {
font-family: 'FormulaCondesedLight';
color:red;
}
即使我添加了上面的代码,也没有应用字体系列。可能是什么问题?演示:https://codesandbox.io/s/floral-bash-byld7?file=/src/styles.css
请检查src的路径以获取正确的命名:
@font-face {
font-family: "FormulaCondesedLight";
src: url("./fonts/FormulaCondensed-Light.otf");
}