<link href="https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900" rel="stylesheet">
How do I call the above Google font family link in CSS file?
<link href="https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900" rel="stylesheet">
How do I call the above Google font family link in CSS file?
You can select font(s) from the list of Google Fonts. After selecting the fonts you want you can press the "(x) family selected" panel at the bottom of page. There's good examples like @import.
Imports must be always first thing on CSS file or it doesn't work.
Use @import
to include the Google Fonts stylesheet from your CSS. Make sure to place the @import
statement at the very top of your CSS file, before any other rules.
@import url('https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900');
#p{
font-family: 'Montserrat', sans-serif;
}
<p id="p">Montserrat font.</p>
<p>Default font.</p>
Use the @import in your css file.
Better to put the link in your html head, @import
loads sequentially and is best avoided
@import url('https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900');
body, html{
font-family: "Montserrat";
}
<h1>Font Face</h1>
You have to use the @import:
@import url('https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900');
Place this code at the top of your CSS:
@import url('https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900');
Here is a JSFiddle demo.