Design comparison
Solution retrospective
Is it right to set a px for the div container and the Qr img? or there is a better way
Community feedback
- @ecemgoPosted over 1 year ago
Some recommendations regarding your code could be of interest to you.
HTML
In order to fix the accessibility issue:
- You need to replace
<div class="container">
with the<main class="container">
tag. You'd better use Semantic HTML, and you can also reach more information about it from Using Semantic HTML Tags Correctly.
After committing the changes on GitHub and you need to deploy it as a live site. Finally, you should click generate a new report on this solution page to clear the warnings.
CSS
- In order to center the card correctly, you'd better add
min-height: 100vh
to thebody
and you don't need to usemargin-top
for it:
body { /* margin-top: 10%; */ min-height: 100vh; }
- Also, you don't need flexbox in the
.container
for this solution
.container { /* display: flex; */ /* flex-direction: column; */ /* justify-content: center; */ /* align-items: center; */ }
Hope I am helpful. :)
Marked as helpful0 - You need to replace
- @UdbhavDalmiaPosted over 1 year ago
You can surely use px for the div container and the Qr image. And I would suggest you reduce the heights of the elements so they would match the original preview.
Marked as helpful0@RaeedShealPosted over 1 year ago@UdbhavDalmia thanks thats helpful but is there a better way than to use fixed px?
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