This is a really nice solution. I only have a few small tweaks to suggest:
- Give the body a little padding or the component a little margin on all sides so it can't hit screen edges as it's doing now.
- The alt text can be shorter. "QR code to FrontendMentor.io" is fine. I wouldmt say "that links to" as that implies you've wrapped it in a link.
- You don't need to import the font twice. Just choose the specific fonts and weights you want and include that one snippet Google fonts provides. You never need to include the preconnect fonts twice in particular.
- Personally I wouldnt use article for this. It's fine to do if you want but there's no benefit to doing it and I'm not sure this is really what article was intended for. The card definitely shouldn't have a section element inside it. You could make this whole card a section if you wanted but not it's inner parts. Again there would be no actual benefit to making it a section except perhaps making the code slightly easier to read/understand as a card is mentally a "section" of content when we look at a design.
Marked as helpful
Oh and answers to your questions:
- Already answered
- Looks fine, just needs that space outside it on small screens.
- You will develop your own instincts and preferences about units over time. The important thing to understand is what the implications are of using each. So you'd only ever want to use pixels when you know something always needs to be a fixed size no matter what the end user's default text size settings are. You want something that never changes - perhaps a border width or image size or min-width/clamp value. Rem on the other hand is what you'll use most of the time because most things we would want to scale along with those text size settings. Em would only be for instances where you want somethings value to relate to the current font size on that element. So perhaps padding on a button or margin-top on paragraphs/headings in a blog article.
- BEM looks fine.
Marked as helpful
@EugeneVuong
Posted
@grace-snow Thank you so much Grace. Your input is valuable to my improvement in HTML and CSS. :)