Used media query for different screen sizes and flexbox for position
Design comparison
Solution retrospective
What is the common/best process used in developing a project web development? Is the media query suitable for different screen devices or there is another way to accomplish the task? Did I use any code in the wrong way?
Community feedback
- @correlucasPosted about 2 years ago
👾Hello Real uNondaba, Congratulations on completing this challenge!
You’ve done really good work here putting everything together, I’ve some suggestions to improve the design:
1.Use
<main>
instead of<div>
to wrap the card container, its better to use<mai>
in this case because you’re indicating that’s the main block of content of this page and also because<div>
doesn’t have any meaning, it's just a block element.2.Every page needs a main heading, the
<h1>
to show which is the most important heading. You need to increase the headings by one level, like h1, h2, h3 to show the titles hierarchy. Remember that you cannot have more than one h1 heading.3.Add a margin of around
margin: 20px
to avoid the card touching the screen edges while it scales down.4.Something I've noticed in your code is that in many occasions you've added some
<div>
to wrap contents that don't really need to be inside of a div block. Note that for this challenge all you need is a single block to hold all the content, can be<div>
or<main>
if you want to use a semantic tag to wrap the content, the cleanest structure for this challenge is made by a block of content with div/main and all the content inside of it (img, h1 and p) without need of any other div or something. See the structure below:<body> <main> <img src="./images/image-qr-code.png" alt="Qr Code Image" > <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!
Marked as helpful2@NondabaPosted about 2 years ago@correlucas, this is helpful. thank your for taking the time to review my code.
0 - @denieldenPosted about 2 years ago
Hi Real uNondaba, congratulations on completing the challenge, great job! 😁
Yes, media query is for resize and adapt the design in different resolution and make the app responsive.
Some little tips for optimizing your code:
- add
main
tag and wrap the card for improve the Accessibility - also you can use
article
tag instead of a simplediv
to the container card for improve the Accessibility img
element must have analt
attribute, it's very important!- remove all
margin
fromcontent
class - use flexbox to the body to center the card. Read here -> best flex guide
- after, add
min-height: 100vh
to body because Flexbox aligns child items to the size of the parent container - instead of using
px or %
use relative units of measurement likerem
-> read here
Hope this help! Happy coding 😉
Marked as helpful1@NondabaPosted about 2 years ago@denielden ,thanks for the helpful tips and articles.
1 - add
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