I was trying to use google fonts on CSS for my webpage but instead of rendering the chosen font, it showed the default sans-serif font. What changes could I make to the code?
h1 {
font-family: 'Montserrat-Black', sans-serif;
font-size: 3rem;
line-height: 1.5;
}
<link href="https://fonts.googleapis.com/css2?family=Montserrat" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Ubuntu" rel="stylesheet">
<h1>test</h1>
2
Answers
As I understood, you want to use the Black version of Montserrat. Here is how you can do it:
First way: For using black version of this font you can import just black version:
In this way, for using Black version of Montserrat you can just set
font-family: 'Montserrat', sans-serif;
Second way: Also you can import all versions and Give
font-weight: 900;
to every where you wanna be black version.………….
If you need just black version, do first way. Else second.