如何从Google字体获取黑色字体粗细

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

请去here结束看Black字体样式。如何在我的页面上获得此样式。这是我到目前为止所尝试的,但它不起作用。

.title{
font-family:'montserrat' sans-serif;
font-weight:900;
font-weight:Black;
}
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">

<div class='title'>LOREM</div>
css fonts
3个回答
1
投票

首先,font-family属性要求用逗号分隔值。此外,您应该在值中使用大写字母。

因此,这......

font-family: 'montserrat' sans-serif;

…应该

font-family: 'Montserrat', sans-serif;

enter image description here

要为字体添加更多权重,请使用自定义菜单:

enter image description here

然后,只需添加相应的font-weightfont-style值:

font-weight: 900;

如果您没有在生成的<link>中指定该权重,则将使用后备族和权重。


1
投票

您可以根据几种变体导入字体。蒙特塞拉特有常规400,Bold 700,Black 900等等。只需选择变体类型并添加该字体,现在就可以了。

根据您的问题,您需要的URL是

<link href="https://fonts.googleapis.com/css?family=Montserrat:900" rel="stylesheet">

1
投票

首先使用'Montserrat', sans-serif;(与,

第二个font-weight:black;无效,所以删除它...

你可以使用font-style:normal

.title{
font-family:'Montserrat', sans-serif;
font-weight:900;
font-style:normal;
}
<link href="https://fonts.googleapis.com/css?family=Montserrat:900" rel="stylesheet">

<div class='title'>black</div>
© www.soinside.com 2019 - 2024. All rights reserved.