EN
CSS - Google Fonts
3 points
In this article, we would like to show you how to use Google Fonts working with CSS.
Quick solution:
xxxxxxxxxx
1
2
<html>
3
<head>
4
<link rel="preconnect" href="https://fonts.googleapis.com">
5
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
6
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap" rel="stylesheet">
7
<style>
8
9
body {
10
font-family: 'Roboto', sans-serif;
11
}
12
13
</style>
14
</head>
15
<body>
16
Example text...
17
</body>
18
</html>
1. Go to the Google Fonts page and choose your font.
2. Select the font style and open View your selected families.
3. Copy and paste link
elements to the <head>
of your HTML, and assign the CSS rules into the element where you want to place the font.