Design comparison
SolutionDesign
Community feedback
- @MelvinAguilarPosted about 2 years ago
Hi @Rahulgit3D2Y π, good job completing this challenge, and welcome to the Frontend Mentor Community! π
I have some suggestions you might consider to improve your code:
- Use the
<main>
tag to wrap all the main content in your solution instead of using<div class="container">
. Also, don't take your component to the body element.
- The container isn't centered correctly. You can use flexbox or grid layout to center elements. You can read more about centering in CSS here.
- Add descriptive text to the alt attribute of the QR image to explain what the QR image does. Upon scanning the QR code, you will be redirected to the frontendmentor.io website, so an example of alternative text would be "QR code to frontendmentor.io". You can read more about alternative text here.
body { text-align: center; min-height: 100vh; /* Set a height */ display: flex; flex-direction: column; justify-content: center; align-items: center; /* Center the element with flexbox*/ /* margin: 3vh 30vw; */ /* Remove all the margin*/ margin: 0; } .container { max-width: 360px; /* Set a width to the container */ padding: 30px; /* Use units instead of percentages */ margin: 20px; /* Add margin to add some space for the container card and the screen edge on mobile devices.*/ align-items: center; background-color: white; border-radius: 5%; box-shadow: 10px 10px hsl(220deg 15% 55%); }
Above all, the project is done wellπ. I hope those tips will help you! π
Good job, and happy coding! π
Marked as helpful1 - Use the
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