在css中嵌入字体Fonte_Nexa-TTF和Fonte_Nexa

问题描述 投票:0回答:1

我正在一个网站上工作,我想要应用以下字体:

1. Source_Nexa-TTF 2. Source_Nexa

我已将上述字体放在css / fonts文件夹中,如下图所示:

enter image description here

在Fonte_Nexa-TTF目录中,我有以下字体:

enter image description here

在CSS中,我在顶部放置了以下代码,但它似乎不起作用。

@font-face {
font-family:"Fonte Nexea";
src: 
url("fonts/Fonte_Nexa-TTF") format("truetype"),
url("fonts/Fonte_Nexa") format("opentype");
}

问题陈述:

我想知道我需要在上面的CSS代码中做出哪些更改才能开始工作。此外,在控制台我收到以下错误:

enter image description here

css fonts font-face http-status-code-403 font-family
1个回答
1
投票

看起来您的引用是针对目录而不是字体本身。尝试在目录中添加特定字体文件的文件名,看看是否有所不同。

@font-face {
font-family:"Fonte Nexea";
src: 
url("fonts/Fonte_Nexa-TTF/fontname.ttf") format("truetype"),
url("fonts/Fonte_Nexa/fontname.otf") format("opentype");
}
© www.soinside.com 2019 - 2024. All rights reserved.