Design comparison
Community feedback
- @MattPahutaPosted 7 months ago
Hi there. Nicely done completing this challenge. You're using semantic HTML landmarks well here and matched the design comp quite closely.
Here's some specific feedback and tips to carry forward to future projects:
-
Always use a modern css reset at the start of the styles in every project. Andy Bell and Josh Comeau both have excellent resets worth checking out.
-
You should use min-height instead of height on your body element. There's no effect for this particular project, but the browser should know it's allowed to grow beyond the viewport height when necessary. Width should not be set on the body. By default, it's 100% and shouldn't be changed.
-
Likewise, the width and height properties of your main element are not necessary. You could remove all these and put a display of grid on your body to produce similar results.
-
Media queries should be set in rem/em, not px. Here's a great resource
-
For your social share component, you're setting base styles using an id selector (#socials) but toggling hidden/show styles using a class (.hidden). I think this is causing some specificity issues and impacting how the card is displaying on different screen sizes in different states. In general, it's best practice to avoid mixing IDs and classes to apply styles.
-
It's bad practice and an accessibility concern to set a font size on the html element. Instead, set the base font you want on the body or a lower-level element.
-
Your div with an ID of share-div-2 doesn't appear to be necessary. I think you can omit this markup and the related JS code.
Good luck with future challenges!
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