Design comparison
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there ๐. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
HTML ๐:
-
Use semantic elements such as
<main>
and <footer> to improve accessibility and organization of your page. -
Since this component involves scanning the QR code, the image is not a decoration, so it must have an
alt
attribute. Thealt
attribute should explain its purpose. e.g.QR code to frontendmentor.io
CSS ๐จ:
- Use
min-height: 100vh
instead ofheight: 100vh
. Theheight
property will not work if the content of the page grows beyond the height of the viewport.
-
Setting
overflow hidden
on the body element can cause unexpected behavior, such as preventing the user from scrolling the page. It can also interfere with other elements on the page, such as fixed-position elementsHere is an image of how it would look on a mobile device : screencapture-qr-code-componentx1-netlify-app
- Update to this to correctly center the card component:
body { background: #d6e2f0; display: flex; /* Flexbox is a layout mode that allows elements to be aligned and organized in any direction */ justify-content: center; align-items: center; /* height: 100vh; */ min-height: 100vh; /* width: 100vw; */ /* overflow: hidden; */ flex-direction: column; } .container { /* margin-top: 15rem; */ . . . } @media only screen and (max-width: 600px) .container { /* margin-top: 8rem; */ }
I hope you find it useful! ๐ Above all, the solution you submitted is great!
Happy coding!
Marked as helpful0@deguzmanmadeleine22Posted almost 2 years ago@MelvinAguilar thank you! this worked like a charm. I was trying to figure out a way to center it without using any margin.
0 -
- @bhargavjyotiPosted almost 2 years ago
Great Work!
- Just use Flexbox or Grid to center the card.
- Use the CSS box shadow property to add shadow to the card. Other than that everything looks great! Keep Improving Happy Coding :)
1
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