Design comparison
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
- @Kamlesh0007Posted over 1 year ago
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 helpful0@Kamlesh0007Posted over 1 year ago@Asongafac have u made the changes or not if u have any issues dm me
0 - @0xabdulkhaliqPosted over 1 year ago
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 theimage
.
- 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 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