@mkboris
Posted
Hi Ahmed-Abdul-ghaffar, congrats on completing your first challenge you did great, here are a few things to review
HTML
- Using many
meta
tags in HTML is not essentially bad, but it's important to use them correctly and ensure they are relevant. - All content should be wrapped within landmarks. Wrap a
main
tag around the .container. Using thearticle
element here might not be the best choice.article
is best suited for content such as blog posts or news articles. - Your image needs a more descriptive
alt
attribute like soalt="Qr Code to Frontendmentor.io"
CSS
- Your CSS class names are clear. If you want a more structured and maintainable naming, you can use the BEM naming convention
- To handle mobile design effectively start by designing for mobile first, applying styles for smaller screens, and then use media queries to adjust the layout for larger screens. (Although you don't need media queries for this particular challenge).
- Change the
height
of thebody
tomin-height
. The .containerwidth
should bemax-width
and it should be defined inrem
- Font-size should be written in
rem
not px - Consider using a modern CSS reset at the start of the styles in every project. Like this one Modern CSS Reset. This will help reset a list of default browser styles.
- You can use the PerfectPixel browser extension to match the design
Marked as helpful
@mkboris
Thank you so much for the brilliant feedback! I learned new things that I wasn’t aware of before, and I've already implemented some of them in the project.
However, I have two questions:
Regarding the <article> element, I researched and found that it is used for self-contained pieces of content. I believe the card I built fits that description—what do you think?
Why should the font size be written in rem instead of px. I am asking because the font size in the style-guide is in px?
@mkboris
Posted
@Ahmed-Abdul-ghaffar I think this card functions more as a component within a page rather than a self-contained piece of content so a div
is better suited than an article
. This article explains Why font-size must NEVER be in pixels