Design comparison
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there π. Good job on completing the challenge !
I have other suggestions about your code that might interest you.
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 π¨:
- Instead of using pixels in font-size, use relative units like
em
orrem
. The font-size in absolute units like pixels does not scale with the user's browser settings. This can cause accessibility issues for users who have set their browser to use a larger font size. You can read more about this here π.
- Use
min-height: 100vh
instead ofheight: 100vh
. Theheight
property can cause your component to be cut off on small screens, such as a mobile phone in landscape mode.
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful1 -
- @HassiaiPosted almost 2 years ago
Replace<div class="container">with the main tag, <h3> with <h1> and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html
To center .container on the page using grid, add min-height:100vh; display: grid place-items: center to the body.
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, this will prevent the content from overflowing on smaller screens and its a responsive replacement.
Give the img a max-width of 100% instead of a width . Increase the width of .container for it to be equivalent to the width of the design
width: 300px
.Add a margin value for all the sides to the article, there is no need to give h1 a font-size the font-size of h1 is the same as p which is 15px.
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0@br123lodoPosted almost 2 years ago@Hassiai thank you for the tips , I will work on it .
1
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