简体   繁体   English

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

[英]embedding fonts Fonte_Nexa-TTF and Fonte_Nexa in css

I am working on a website on which I want to apply the following fonts: 我正在一个网站上使用以下字体:

1. Fonte_Nexa-TTF 1. Fonte_Nexa-TTF
2. Fonte_Nexa 2. Fonte_Nexa

I have placed the above fonts in the css/fonts folder as shown below in an image: 我将上述字体放置在css / fonts文件夹中,如下图所示:

在此处输入图片说明


Inside Fonte_Nexa-TTF directory, I have the following fonts: Fonte_Nexa-TTF目录中,我具有以下字体:

在此处输入图片说明

In the CSS, I have placed the following codes on the top but it doesn't seem to work. 在CSS中,我将以下代码放在顶部,但似乎不起作用。

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

Problem Statement: 问题陈述:

I am wondering what changes I need to make in the CSS codes above so that it start working. 我想知道我需要在上面的CSS代码中进行哪些更改,以便它开始起作用。 Also, at console I am getting the following error: 另外,在控制台上,我收到以下错误:

在此处输入图片说明

It looks like your references are for directories instead of the fonts themselves. 看起来您的引用是针对目录而不是字体本身。 Try adding the file names for the specific font file within the directory and see if that makes a difference. 尝试在目录中添加特定字体文件的文件名,看看是否有区别。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM