为什么我的字体不像Google字体上出现?
我从 google fonts 获得了两种字体,并将它们应用到我的 CSS 文档中。然后我将它们添加到我的文档中,但由于某种原因它们没有像网站上显示的那样显示。
这是我的代码:
@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@500&family=Libre+Baskerville&display=swap');
h1, h2, h3, h4, h5, h6 {
font-family: 'League Spartan', sans-serif;
}
p {
font-family: 'Libre Baskerville', serif;
}
这是两种字体的链接:
I have gotten two fonts from google fonts, and have applied them to my CSS document. Then I added them to my document, but they don't show up as what appeared on the website for some reason.
Here is my code:
@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@500&family=Libre+Baskerville&display=swap');
h1, h2, h3, h4, h5, h6 {
font-family: 'League Spartan', sans-serif;
}
p {
font-family: 'Libre Baskerville', serif;
}
Here is the link to both fonts:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了它是什么:
@Import必须在其他CSS之前处于样式表的顶部。
I have found what it is:
The @import has to be at the top of the stylesheet, before any other css.