Design comparison
Community feedback
- @Islandstone89Posted 7 months ago
HTML:
- The image has meaning, so it must have proper alt text. Write something short and descriptive, without including words like "image" or "photo". Screen readers start announcing images with "image", so an alt text of "image of qr code" would be read like this: "image, image of qr code". The alt text must also say where it leads(frontendmentor website).
CSS:
-
Including a CSS Reset at the top is good practice.
-
Add around
1rem
ofpadding
on thebody
, so 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 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. I would also decrease the font size, so the card doesn't get too tall. -
line-height
must also never be inpx
. Use numbers instead; for example, if you want aline-height
twice the size of the element's font size, writeline-height: 2;
. -
On the image, add
display: block
andmax-width: 100%
- the max-width prevents it from overflowing its container. -
I would decrease the
padding
on the card to around16px
. -
As the design doesn't change, there is no need for any media queries. When you do need them, they should be in rem, not px. Also, it is common practice to do mobile styles first and use media queries for larger screens.
Marked as helpful1@SurafelFikaduPosted 7 months ago@Islandstone89 Hey Haberg Thank You for your time and constructive comment. It's difficult for me to say your comments only comment it's another part of lesson. Thanks A lot .
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