Design comparison
Solution retrospective
It's my first challenge here so things are a bit rough around the edges. My main problem was how to center all the elements the right way and be as committed to the original component as possible. of course there are some diffrences in fonts and colors, also dimensions. I'd be grateful if you can advise me on how to better center elements, especially in such cases.
Community feedback
- @MelvinAguilarPosted 11 months ago
Hello there π. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
Background π:
-
You should not recreate the background, you used the image
desktop-preview.jpg
to create your solution, but that image is for decoration and is a nice way to present the challenge, for example, you can use it in your github README.You must use the images
desktop-design.jpg
andmobile-design.jpg
to create your solution.
Alt text π·:
-
The
alt
attribute should explain the purpose of the image. Uppon scanning the QR code, the user will be redirected to the frontendmentor.io website, so a betteralt
attribute would beQR code to frontendmentor.io
If you want to learn more about the
alt
attribute, you can read this article. π.
CSS π¨:
- You should use the
box-sizing: border-box
property to make thewidth
andheight
properties include the padding and border of the element. This will make it easier to calculate the size of an element. You can read more about this here π.
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful0@Med-koPosted 11 months ago@MelvinAguilar thank you so much for the feedback.
I was literally wondering which image I should base my solution on lol kinda confusing! I'll keep this in mind when I'm doing my next challenge. As for the alt I'll make sure to write a more explanatory one.
I actually forgot about box-sizing, that would have made things easier.
0 -
- @danielmrz-devPosted 11 months ago
Hello @Med-ko
Your project looks great!
I see that you used
position
to center the card. It's a good option for a project with one centered element, like this one, but for bigger projects, it can be a problem. Here's another very efficient way to place elements in the middle of the page:You can apply this to the body (in order to work properly, you can't use position or margins):
body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
- Also, wrap the card with
main
tag instead of adiv
. This makes your HTML code more semantic and improves SEO optimization and accessibility.
I hope it helps!
Other than those details, you did an excellent job on your first project π
Marked as helpful0@Med-koPosted 11 months ago@danielmrz-dev Thank you so much for the advice, I'll make sure to apply the relevant changes!
0 - Also, wrap the card with
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