QR Code Component with HTML and CSS -frontendmentor.io
Design comparison
Community feedback
- @frank-itachiPosted over 1 year ago
Hello there π. You did a good job!
I have some suggestions about your code that might interest you.
HTML π:
- Wrap the page's whole main content in the
<main>
tag. - Make sure that the
<img>
elements in your HTML code has an alternate (descriptive text) short text. The reason for this is that screen readers canβt translate images into text. So to fix this you can do the following<img src=ββ¦β alt=βshort textβ >
CSS π¨:
- You can use grid or flexbox to center the content no matter the viewport size. Since I use grid to achieve such purpose, you can do the following:
body { min-height: 100vh; display: grid; align-items: center; justify-content: center; }
As I said, you can use flexbox to center the content and it will work as well.
body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
I hope you find it useful! π Above all, the solution you submitted is great!
Happy
<coding />
π!Marked as helpful0@karayanikburakPosted over 1 year ago@frank-itachi thanks for feedback. Are there any courses or sth you can recommend to me?
0@frank-itachiPosted over 1 year ago@karayanikburak
Check out the Kevin Powell YouTube channel. It'll help you a lot...
0 - Wrap the page's whole main content in the
- @msutcliffe2303Posted over 1 year ago
Hey, Congratulations on completing the task!
Theres a few things you could change in this, the first would be using flex or grid to center the content for you. Make sure you use a min-height:100vh to do this.
Replace your DIV with main to ensure you are using a landmark and maybe replace the <p class="intro"> with a heading tag. Try using a <h1> as its the most important part.
Otherwise, good job!
Marked as helpful0
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