基于创建反应的项目添加了字体,但不起作用
我正在使用Create-React-App,而不是不弹出。 我在index.html文件中导入。并给它默认字体。但是它不起作用。
<style>
@font-face {
font-family: Gumela;
src: url("../src/fonts/*");
}
* {
font-family: "Gumela";
font-weight: normal;
font-size: 20px;
}
body {
margin: 0;
}
</style>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以在app.css文件上插入字体脸
You can insert font-face on your App.css file
尝试在app.css或index.css文件中导入字体。
然后尝试:
Try importing the fonts in your app.css or index.css file.
And try:
我在这里导入字体:和它对我有用。
I imported the font here: https://www.onlinewebfonts.com/download/00561b492d88a5287a5def1e83a34882 and it worked for me.
只需在您的样式标签之前将其添加到头。
&lt; link href =“ // db.onlinewebfonts.com/c/c/00561b492d88a5287a5287a5287a5def1e83a34882?family = gumela“
just add this in head before your style tag.
<link href="//db.onlinewebfonts.com/c/00561b492d88a5287a5def1e83a34882?family=Gumela" rel="stylesheet" type="text/css"/>