HTML and CSS QR code Solution

Solution retrospective
What would be the best way to position the card in the center of the window?
Are there any optimizations I can make to my CSS?
Are there any best practices I could have used instead?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @rachit0706
Congratulations @alexdeanb for completing this challenge! I do have a few suggestions for you:
- First of all wrapping your content inside a main tag for better semantics. Don't directly give the body element so many styles. Give the styles like flex to your main element.
- You can use flexbox with column direction for your card component. It will give a better layout. Use justify conent as center like you did for body.
- Doing the above might fix your accessibility issues as well.
Marked as helpful - @correlucas
👾Hello Alex, Congratulations on completing this challenge!
Great code and great solution! I’ve few suggestions for you that you can consider adding to your code:
The HTML structure is fine and works, and you can reduce at least 20% of your code by cleaning the unnecessary elements, you start cleaning it by removing some unnecessary
<div>
. For this solution you wrap everything inside a single block of content using<div>
or<main>
(better option for accessibility) and put inside the whole content<img>
/<h1>
and<p>
.<body> <main> <img src="./images/image-qr-code.png" alt="QR Code Frontend Mentor" > <h1>Improve your front-end skills by building projects</h1> <p>Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p> </main> </body>
✌️ I hope this helps you and happy coding!
Join 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