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 π:
- It is not valid in HTML to enclose a h2 within a paragraph element, you can check this issue here: https://caninclude.glitch.me/caninclude?child=h2&parent=p
- Wrap the page's whole main content in the
<main>
tag.
Alt text π·:
-
The
alt
attribute should explain the purpose of the image. Uppon scanning the QR code, the user will be redirected to the frontendmentor.io website, so a betteralt
attribute would beQR code to frontendmentor.io
If you want to learn more about the
alt
attribute, you can read this article. π.
CSS π¨:
-
To center the component in the page, you should use Flexbox or Grid layout. You can read more about centering in CSS here π.
body { background-color: hsl(212, 45%, 89%); font-family: 'Outfit', sans-serif; min-height: 100vh; display: grid; place-content: center; } .container { /* margin: 100px auto auto; */ }
CSS Reset π:
-
You should use a CSS reset. A CSS reset is a set of CSS rules that are applied to a webpage in order to remove the default styling of different browsers.
CSS resets that are widely used:
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
1 - @HassiaiPosted almost 2 years ago
Replace <div class="container"> with the main tag and <p> <h2> with <h1> to fix the accessibility issues. click here for more on web-accessibility and semantic html..
To center .container on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center .container on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center .container on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
Replace the height in .container with a padding value for all the sides. Give thee img a max-width of 100% Give . text a margin value for all the text a p a margin bottom value.
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
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