Design comparison
Community feedback
- @HassiaiPosted almost 2 years ago
Replace<div class="container">with the main tag and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html. There is no need for <br> in the html.
To center .content on the page using flexbox, add min-height: 100vh to .container and remove the padding value.
There is no need for a height in .content, replace that with a padding value for all the sides. padding.
padding:15px
increase the width of .content for it to be equivalent to the width of deisgn.width:300px
. Give the img a max-width of 100% instwad of a width a height values.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
Give h1 and p the same margin-left, margin-left and margin-top values. give p a margin-bottom value and h1 the same font-size value as p.
h1, p{ margin: 0 15px; margin-top: 15px} p{ margin-bottom: 15px}
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful1 - @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 π:
- Use semantic elements such as
<main>
and<footer>
to improve accessibility and organization of your page.
- The
<br>
tag is not a semantic element. If a screen reader user is reading the page, they will hear "line break", which breaks the flow of the content. Instead, use CSS properties likemargin
andpadding
to add vertical space between elements.
Alt text π·:
- The
alt
attribute should not contain underscores or hyphens, it must be human readable and understandable.
-
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 π.
- Setting a defined
height
for the card component is not recommended. The content should define the component height, otherwise, it will not be allowed to extend beyond your specifications.
.content { padding: 10px; text-align: center; max-width: 250px; /* height: 64vh; */ }
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful0 - Use semantic elements such as
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