Design comparison
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?
Community feedback
- @rachit0706Posted about 2 years ago
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 helpful1@alexdeanbPosted about 2 years ago@rachit0706 Thank you for the advice! I committed a new version if you'd like to take a look at it.
Finally passed validation!
1 - @correlucasPosted about 2 years ago
👾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!
0@alexdeanbPosted about 2 years ago@correlucas The only div remaining is the attribution for frontendmentor.
I reworked it with a main surrounding the content, and a section to denote the card in the middle.
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