gpt4 book ai didi

html - 使用 font-face 导入字体失败

转载 作者:太空宇宙 更新时间:2023-11-04 08:48:22 25 4
gpt4 key购买 nike

这是我的 style.css

@font-face {
font-family: 'Lato-Regular';
src: url("../../fonts/Lato-Regular.woff") format("woff"), url("../../fonts/Lato-Regular.woff2") format("woff2");
}

html文件

  <div class="text-center" style="font-family:Lato-Regular;color:#bef4f7;margin-top:-23px;font-size:32px">
Text Example
</div>

它失败并抛出我的错误

enter image description here

我做错了什么?

最佳答案

这是你的文件路径。它通向一个名为“assets”的文件夹。也许文件路径应该是 url("../fonts/Lato-Regular.woff")(少一个 ../)(或者多一个 - 只是在这里猜测,但无论如何,检查文件路径)

关于html - 使用 font-face 导入字体失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43614924/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com