Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

HTML, CSS

ajasmine94β€’ 20

@ajasmine94

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

I think I am most proud of the fact that I was able to make the simple design from scratch (in terms of styling) provided the asset..

What challenges did you encounter, and how did you overcome them?

Mostly with setting the box on the middle. I always find setting a particular element on a position challenging. After a lot of trial and errors, and making use of my existing knowledge on CSS, I was able to come up with the final outcome.

What specific areas of your project would you like help with?

I was able to copy the design but I really think it can be improved on especially with setting the position of the box in the middle as I'm not sure if my solution to that is even correct..

Community feedback

Dylan de Bruijnβ€’ 3,230

@DylandeBruijn

Posted

@ajasmine94

Hiya! πŸ‘‹

Congratulations on your solution, it looks very close to the design! I can tell you put a lot of effort into it.

Things you could improve ✍️

  • I suggest adding a bit of padding to your body element so the card has some space around it on smaller viewports.

  • Try experimenting with the CSS layout tool Flexbox, it will help you greatly structuring elements on your webpage. You can try centering your card for example.

  • To learn more about centering elements I recommend reading this guide.

  • You could add a min-height: 100vh to your body element so it takes up the full height of the viewport while still being able to grow when the content inside it grows.

  • Try experimenting with CSS variables, they help you make your CSS values more reusable across your code.

  • I suggest using clear descriptive CSS classes like .card, .card-title and .card-description.

  • Try using semantic HTML elements like main, section and article.

  • Try using using relative CSS units like rem and em they make your layout more adaptable.

  • Be careful with setting a fixed width and height on your elements. If the content in these elements grows beyond these restrictions you’ll run into overflow issues. Keeping the height at auto - which block elements are by default - will be fine in most cases.

  • You don’t need to put width: 100% on block elements, they already take up the full width of their parents by default.

  • Try styling your elements using classes instead of ID’s. Most of the time they are the better choice. ID’s are mostly used to select elements using JavaScript, navigation on the page itself and to style unique elements.

  • I suggest leaving the width of your body as auto which it is by default. So to achieve this you can remove the fixed width.

I hope you find my feedback helpful! 🌟

Let me know if you have more questions and I'll do my best to answer them. πŸ™‹β€β™‚οΈ

Happy coding! 😎

Marked as helpful

1

ajasmine94β€’ 20

@ajasmine94

Posted

@DylandeBruijn Hi Dylan, after learning about flexbox I have updated my solutions. It took a while but I wanted to thank you so much for the time and effort of providing this detailed feedback!! it helped greatly :)

0
Daniel πŸ›Έβ€’ 44,270

@danielmrz-dev

Posted

Hey there! πŸ™‹πŸ½β€β™‚οΈ

Congrats on completing the challenge! βœ…

Your project looks fantastic!

Here's a tip to make it even better:

Using margin and/or padding isn't always the best way to center an element. Try this method to center an element vertically and horizontally:

πŸ“Œ Apply this CSS to the body (skip position or margins to make it work correctly):

body {
    min-height: 100vh;
    display: flex; 
    justify-content: center;
    align-items: center;
}

Hope this helps!

Keep up the great work!

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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