Design comparison
Solution retrospective
I struggled a little with adding web fonts, so I wonder if there is a better way of adding fonts. I copied the link tags given in google. Thanks
Community feedback
- @AdrianoEscarabotePosted about 2 years ago
Hi Jack, how are you?
Welcome to the front-end mentor community!
I really liked the result of your project, but I have some tips that I think you will enjoy:
- every Html document must contain the main tag, so we can identify the main content, to fix this, wrap all the content with the main tag. HTML5 landmark elements are used to improve navigation experience on your site for users of assistive technology.
- Consider using rem for font size .If your web content font sizes are set in absolute units, such as pixels, the user will not be able to re-size the text or control the font size based on their needs. Relative units “stretch” according to the screen size and/or user’s preferred font size, and work on a large range of devices.
The rest is great!
I hope it helps... 👍
Marked as helpful0@JackgomezPosted about 2 years agoHi @AdrianoEscarabote, thank you so much for taking the time to check my project. I really appreciate your tips, I had no idea about (rem) especially. Thanks for your support!
1 - @amalkarimPosted about 2 years ago
Hi Jack.
Congrats on your first submission in Frontend Mentor!
About your question, I think there are two ways to add Google Fonts to your project. The first is by using
<link>...</link>
. Here is the full code<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=Outfit:wght@400;700&display=swap" rel="stylesheet">
The second way is by using @import method inside your css file before any other styling, like this
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&display=swap');
Whether you want to use the first or the second method, it's really up to you. But for me, I personally like the
@import
method, because it's more concise.Hope this helps!
Marked as helpful0@JackgomezPosted about 2 years ago@amalkarim. Thank you for your explanation, it makes a lot more sense now and will probably use @import in the future too. Thanks again!
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