Design comparison
Solution retrospective
Had a problem with the Google fonts online. I was not able to use font-weight when included from the CDN. But when I downloaded them and included them locally the font-weight property started to work properly.
Am sure this is not a good approach since it will slow down the page's loading speed. So, in the next projects I will try to use the ones from the CDN and figure out why the weights are not working on them.
Community feedback
- @Agnik7Posted 11 months ago
Hi, I think I know why the font weight was not working. When importing Google Fonts, you need to select the font weights as well. For example, A ROBOTO font will have different options, like 300 light, regular 400, bold 700 etc. You need to select all the font-weight you plan on using. Then you don't need to download the font pack, it will work with the cdn only.
Hope this helps solve your issue.
Happy Coding!!
Marked as helpful0@cgambePosted 11 months ago@Agnik7 Thanks a lot, but I did select 400 and 700 but it was still not working.
0@Agnik7Posted 11 months ago@cgambe Were you writing
font-weight: bold;
or
font-weight: 700;
0@Agnik7Posted 11 months ago@cgambe how were you importing it? Using
<link>
or@import
?0
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