html - 自定义 Google 字体不适用于 Flask
问题描述
我目前正在尝试使用 Google 字体在 Flask 上托管的网页上呈现自定义字体,但该字体不适用。当我在没有 Flask 的浏览器中尝试相同的 html 和 css 文件时,字体会显示。Google 字体可能无法与 Flask 一起使用的任何原因?
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Fredoka+One" rel="stylesheet">
<link rel="stylesheet" href="googleFonts.css">
<title>Google Fonts</title>
</head>
<body>
<p class="header">This is Google Fonts</p>
</body>
</html>
CSS
.header {
font-family: 'Fredoka One', cursive;
font-size: 50px;
}
解决方案
推荐阅读
- selenium - 如何将 10 个带有参数值的文件注入到 selenium 测试中并按顺序执行
- flutter - 方向生成器给出错误的方向
- .net - Xamarin,使用 .net Standard 2.0 和 Dependecy Services 创建 NuGet 包
- code-generation - 如何使用编写的 Xtend Generator 代码在 Xtext 中生成?
- azureservicebus - Azure 服务总线和 CAP 定理
- android - 如何在张量流上检测图像对象?
- android - 在后台使用 Fence API 是否需要 Android P 中的前台服务
- javascript - 在 setInterval 内安排 setTimeout
- git - 如何快速从 SVN 迁移到 Git?
- python - 在 Python 中连接到 MS Access