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

QR code card using html and CSS

Asongafac 110

@Asongafac

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


I had some difficulties in making the main div tag to move to the center of my page. so I had to use padding all round, so that it appears at the center of the page. how can I solve this difficulty of mine ?

also, I had difficulties in giving my image an automatic width so as to avoid giving it a specific width.

Community feedback

@Kamlesh0007

Posted

1.To center a div element on a page, you can use the CSS flexbox layout body { display: flex; justify-content: center; align-items: center; height: 100vh; }

2.As for the image, you can use the CSS max-width property to set the maximum width of an image while allowing it to scale proportionally. do all these things and ur design will be perfect img { max-width: 100%; height: auto; }

body { background-color: hsl(212, 45%, 89%); display: flex; justify-content: center; width: 100vw; align-items: center; height: 100vh; } .code{ width: 280px; }

Marked as helpful

0

Asongafac 110

@Asongafac

Posted

@Kamlesh0007 thank you so much. very helpful

0

@Kamlesh0007

Posted

@Asongafac have u made the changes or not if u have any issues dm me

0

@0xabdulkhaliq

Posted

Hello there 👋. Congratulations on successfully completing the challenge! 🎉

  • I have other recommendations regarding your code that I believe will be of great interest to you.

QR iMAGE ALT TEXT 📸:

  • Since this component involves scanning the QR code, the image is not a decoration, so it must have an alt attribute.
  • The alt attribute should explain the purpose of the image.
  • E.g. alt="QR code to frontendmentor.io"
<img src="/images/image-qr-code.png" alt="QR code to frontendmentor.io">

.

I hope you find this helpful 😄 Above all, the solution you submitted is great !

Happy coding!

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