【问题标题】:How to change font in css? [duplicate]如何更改css中的字体? [复制]
【发布时间】:2019-11-23 03:04:15
【问题描述】:

我想设计一个简单的网站,但我一直在努力更改字体。我看了很多教程并阅读了文档,但我不明白我做错了什么!

这是我的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 浏览器(均已更新)上对其进行测试

你们知道我做错了什么吗?

谢谢!

【问题讨论】:

    标签: html css fonts


    【解决方案1】:

    让 URL 拼写正确。

    【讨论】:

    • 我查过了,应该是对的
    猜你喜欢
    • 2023-03-21
    • 1970-01-01
    • 2021-11-17
    • 2019-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-01
    • 1970-01-01
    相关资源
    最近更新 更多