html - 如何更改css中的字体?
问题描述
我想设计一个简单的网站,但我一直在努力改变字体。我看了很多教程并阅读了文档,但我不明白我做错了什么!
这是我的html:
<html>
<head>
<title>My website</title>
<link rel='stylesheet' href="style.css">
</head>
<body>
<p class="par">Perchè non si riesce a cambiare font??</p>
</body>
这就是 style.css
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
src: url("fonts/Inter-Regular.woff2") format("woff2"),
url("fonts/Inter-Regular.woff") format("woff");
}
.par {
font-size: 100px;
font-family: Inter;
}
我真的不知道如何使它工作。
我目前正在 Windows 10 上的 Firefox 和 Chrome 浏览器(均已更新)上对其进行测试
你们知道我做错了什么吗?
谢谢!
解决方案
确保 URL 拼写正确。
推荐阅读
- algorithm - 获取最接近的 k 个项目的最有效实现
- javascript - 如何在我的 Angular 4.x 项目中使用 js 库作为模块?
- asp.net-web-api - 如何在 asp.net web api 项目中实现 soa 概念?
- apache-spark - 为什么persist(StorageLevel.MEMORY_AND_DISK) 给出的结果与使用HBase 的cache() 不同?
- react-native - 为什么显示红色偶数代码是正确的?
- python - 查找模式的所有匹配项并在文本文件中替换它们
- c# - 为什么我的数据绑定对 PropertyChange 没有反应?
- javascript - jQuery评论系统不工作
- reactjs - 删除一个使用 react-select 模块呈现的选择框
- python-3.x - Python3 中的 print() 是原子的吗?