Html 如何在我的网站中使用字体

Html 如何在我的网站中使用字体,html,css,fonts,Html,Css,Fonts,我试图在我的网站上使用一些字体,但它正在生效。 我为我网站的字体创建了一个文件夹,并在文件夹中添加了字体ttf文件 然后在css文件中,我添加了以下内容: @font-face { font-family: Lato; src: url(http://www.types4u.org/n/font/Lato.ttf) format("truetype"); font-family: Arbutus; src: url(http://www.types4u.org/n/font/Arbutus.tt

我试图在我的网站上使用一些字体,但它正在生效。 我为我网站的字体创建了一个文件夹,并在文件夹中添加了字体<代码>ttf文件

然后在css文件中,我添加了以下内容:

@font-face {
font-family: Lato;
src: url(http://www.types4u.org/n/font/Lato.ttf) format("truetype");
font-family: Arbutus;
src: url(http://www.types4u.org/n/font/Arbutus.ttf) format("truetype");
font-family: Actor;
src: url(http://www.types4u.org/n/font/Actor.ttf) format("truetype");
font-family: LeagueGothic;
src: url(http://www.types4u.org/n/font/LeagueGothic.ttf) format("truetype");
font-family: LibreBaskerville;
src: url(http://www.types4u.org/n/font/LibreBaskerville.ttf) format("truetype");
}

您确定以后要设置字体吗?您发布的代码将使字体对您可用,但除非您告诉它,否则它不会使用这些字体。假设您已经这样做了,但它仍然并没有显示出来,我很想使用。因此,对于Lato字体,您将包括

<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
至少,我想你是在问这个问题。如果您可以更具体或提供更多的上下文/代码,您可能会有更多的人帮助您。

可能重复-
h1 {
  font-family: 'Lato', sans-serif;
}