我知道这是一个简短的问题,但如何在文本中使用多种自定义Google字体,即Baloo和Roboto?在本例中,文本应为Roboto,标题应为Baloo。耽误您时间,实在对不起。
发布于 2017-03-03 02:56:48
你只需为你想使用的每种字体点击“选择这个字体”,谷歌就会给你一个带有多种字体的link标签。还可以为每种字体包含多个link标签。
h1 {
font-family: Baloo;
}
h2 {
font-family: Roboto;
}<link href="https://fonts.googleapis.com/css?family=Baloo|Roboto" rel="stylesheet">
<h1>Baloo</h1>
<h2>Roboto</h2>
发布于 2017-03-03 02:54:39
选择字体转到https://fonts.google.com/
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
注意:还可以通过为族设置管道来获得具有多种字体的一条线。
<head> tagfont-family的字体。如下例所示:
h1{
font-family: "Baloo"
}
p{
font-family: "Roboto"
}<!DOCTYPE html>
<head>
<link href="https://fonts.googleapis.com/css?family=Baloo|Roboto" rel="stylesheet">
</head>
<body>
<h1>Baloo</h1>
<p>Roboto</p>
</body>
发布于 2020-11-13 15:16:35
谷歌字体现在使用css2,上面的答案已经过时了。
使用css2的解决方案是:https://fonts.googleapis.com/css2?family=Baloo&family=Roboto
https://stackoverflow.com/questions/42563606
复制相似问题