css 如何在我的项目中使用“Lato”字体系列?[关闭]

hs1rzwqc  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(83)

已关闭。此问题需要details or clarity。目前不接受回答。
**要改进此问题吗?**通过editing this post添加详细信息并阐明问题。

9年前就关门了。
Improve this question
我在我的.css文件中使用了这样的样式,但它不起作用。我该怎么做才能使我的代码起作用?

font-family: Lato, Helvetica, sans-serif;

字符串
友情链接:http://www.google.com/fonts/specimen/Lato

zsbz8rwp

zsbz8rwp1#

请把这个代码放在标题部分

<link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>

字符串
并在你的css中使用font-family: 'Lato', sans-serif;。例如:

h1 {
    font-family: 'Lato', sans-serif;
    font-weight: 400;
}

也可以手动使用

fontSquiral生成.ttf字体
并可以尝试此选项

@font-face {
        font-family: "Lato";
        src: url('698242188-Lato-Bla.eot');
        src: url('698242188-Lato-Bla.eot?#iefix') format('embedded-opentype'),
        url('698242188-Lato-Bla.svg#Lato Black') format('svg'),
        url('698242188-Lato-Bla.woff') format('woff'),
        url('698242188-Lato-Bla.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
}


这样叫

body {
  font-family: 'Lato', sans-serif;
}

91zkwejq

91zkwejq2#

here下载并提取LatoOFL.rar,然后转到TTF并打开此font-face-generator,单击Choose File选择要使用的字体并单击生成,然后下载它,然后转到html文件,打开它,您可以看到这样的代码

@font-face {
        font-family: "Lato Black";
        src: url('698242188-Lato-Bla.eot');
        src: url('698242188-Lato-Bla.eot?#iefix') format('embedded-opentype'),
        url('698242188-Lato-Bla.svg#Lato Black') format('svg'),
        url('698242188-Lato-Bla.woff') format('woff'),
        url('698242188-Lato-Bla.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
}
body{
    font-family: "Lato Black";
    direction: ltr;
}

字符串
更改源代码和给予的网址,你的这个字体目录放置,现在你可以使用它在您的网站.
如果你不想下载它使用这个

<link type='text/css' href='http://fonts.googleapis.com/css?family=Lato:400,700' />

相关问题