Design comparison
Community feedback
- @Islandstone89Posted 10 months ago
HTML:
-
Use the appropriate semantic HTML landmarks whenever needed. Instead of
<div role="main">
, use<main>
.Every webpage needs a<main>
that wraps all of the content, except for<header>
andfooter>
. This is vital for accessibility, as it helps screen readers identify the "main" section of a page. Change the first<div>
into a<main>
, and use a class instead of an ID. -
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.io).
-
Remove the
<span>
, it is not needed.
CSS:
-
It's good practice to include a CSS Reset at the top.
-
font-family
should be placed on thebody
. -
You don't need to set
text-decoration: none
, and if you did it should be set on links, not all elements. -
font-size
must never be in px. This is bad for accessibility, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead. -
On
body
, removegrid-template-rows
, and changeheight
tomin-height
. -
Remove
width
andheight
on the card. Add amax-width
of around20rem
to prevent it from getting too wide on larger screens. -
Remove
width
andmargin-top
on the image. Adddisplay: block
andmax-width: 100%
- the max-width prevents it from overflowing its container. -
To create the space between the image and the edge of the card, set
padding
on all 4 sides of the card. -
Remove
width: 100%
on.card-content_info
, it is not needed. A<div>
is a block element, meaning it takes up 100% of its parent width by default.
Marked as helpful0@NantuePosted 10 months agohello @Islandstone89, thank for the feedback, It really helped me 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