gpt4 book ai didi

css - 不能将 @font-face 与 Font Squirrel 转换一起使用

转载 作者:太空宇宙 更新时间:2023-11-04 05:03:41 26 4
gpt4 key购买 nike

我一直在尝试在我的网页上添加我自己的字体,但我仍然不知道如何使用 Font Squirrel 转换器。我下载了免费的 .ttf 字体,并使用生成器将其转换为如下所示:

@font-face 
{
font-family: 'AbiteRegular';
src: url('fonts/abite-webfont.eot');
src: url('fonts/abite-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/abite-webfont.woff') format('woff'),
url('fonts/abite-webfont.ttf') format('truetype'),
url('fonts/abite-webfont.svg#AbiteRegular') format('svg');
font-weight: normal;
font-style: normal;
}

fonts 是我保存 .ttf 文件转换的文件夹。我这样使用它:

body 
{
font-family: 'AbiteRegular';
}

所有这些配置都在 .css 文件中。但正文忽略了这一点。你知道为什么会这样吗?

最佳答案

你的字体 URL 可能有问题

url('fonts/abite-webfont.eot');...

或者您使用的浏览器不支持动态字体。

关于css - 不能将 @font-face 与 Font Squirrel 转换一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10929744/

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