Design comparison
Community feedback
- @Islandstone89Posted 3 months ago
HTML:
-
The
<main>
element holds all of the content on a page, except for the header and the footer. The card would likely not be the only component on a page, hence I would wrap it in a<div class="card">
inside of<main>
. -
The alt text must also say where it leads(the frontendmentor website). A good alt text would be "QR code leading to the Frontend Mentor website."
-
I would change the heading to a
<h2>
- a page should only have one<h1>
, reserved for the main heading. As this is a card heading, it would likely not be the main heading on a page with several components. -
.attribution
should be a<footer>
, and you should use<p>
for the text inside. The footer must be placed outside of the main.
CSS:
-
I like to add
1rem
ofpadding
on thebody
, to ensure the card doesn't touch the edges on small screens. -
On the
body
, changeheight
tomin-height
- this way, the content will not get cut off if it grows beneath the viewport. -
Remove the margin on the card.
-
Add
flex-direction: column
andgap: 2rem
onbody
. -
Remove all widths in
px
. -
Add a
max-width
of around20rem
on the card, to prevent it from getting too wide on larger screens. -
font-size
must never be in px. This is a big accessibility issue, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead. -
Change the color of the paragraph. It has a contrast ratio of
2.7 / 1
, which doesn't fulfill the Web Content Accessibility Guidelines AA Requirement. For regular text, the contrast ratio must be at least4.5 / 1
. For simplicity, you can just use the heading color, which is much darker. -
Since all of the text should be centered, you only need to set
text-align: center
on the body, and remove it elsewhere. The children will inherit the value. -
On the image, add
display: block
and changewidth
tomax-width: 100%
- the max-width prevents it from overflowing its container. -
As the design doesn't change, there is no need for any media queries. When you do need them, they should be in
rem
orem
, not px. Also, it is common practice to do mobile styles first and use media queries for larger screens.
0 -
- @SamanthaJowaPosted 3 months ago
Your implementation was well executed. Well done! However, you could have paid more attention to the sizing of your elements. Overall I think it's great. I also took a few notes from your code
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