Design comparison
Solution retrospective
pls can someone explain to me how to use an online font in your website
Community feedback
- @iniyan-webPosted almost 3 years ago
Hi Abdulsamad,
You can add required fonts from google fonts.
-> In html, you can link the fonts like below:
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2? family=Montserrat:wght@700&display=swap" rel="stylesheet" />
-> In CSS, you can import fonts like below:
@import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');
For above both cases, you can use the font added like below.
In CSS:
body { font-family: "Montserrat", sans-serif; }
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord