【发布时间】:2020-11-27 19:15:45
【问题描述】:
只有当我从计算机打开索引文件时,我网站上的 Google 字体才能按预期工作。当我在互联网上上传时,字体无法正常工作(请参阅下面的图片和代码)。 谢谢您的帮助! :)
网址:http://veganrecipes.clanweb.eu/
html代码:
<head>
<title>Krajčírstvo Jana Fürhofferová</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300&family=Dancing+Script&display=swap" rel="stylesheet">
css代码:
.navbar-brand {
font-size: 4vw;
text-align: center;
font-family: 'Dancing Script', cursive;
}
.nav-item {
font-size: 25px;
font-family: 'Comfortaa', cursive;
padding: 15px;
}
.heading {
font-size: 30px;
font-family: 'Comfortaa', cursive;
text-align: left;
font-weight: bold;
}
p {
font-size: 20px;
font-family: 'Comfortaa', cursive;
text-align: left;
line-height: 160%;
}
.text {
line-height: 200%;
}
【问题讨论】:
-
如果字体正在加载,请检查开发者控制台中的网络选项卡。
-
或者这种字体不能与“čakať”、“hádzať”等“标点符号”一起使用
标签: html css google-fonts