Design comparison
Community feedback
- @Islandstone89Posted 9 months ago
HTML:
-
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.main
to a<main>
. -
Remove the width and height attribute on the image.
-
The alt text should be written naturally, without using
-
between the words. 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).
CSS:
-
It's good practice to include a CSS Reset at the top.
-
Use the style guide to find the correct
font-family
. -
Reduce the
padding
onbody
to around1rem
. -
On
body
, addmin-height: 100svh
andjustify-content: center
- this will center the card vertically. -
Remove the fixed width and height on the card, this is something you rarely should do.
-
Add a
max-width
of around20rem
on the card, to prevent it from getting too wide on larger screens. -
font-family
should be set onbody
, and removed elsewhere - the children ofbody
inherit the font from their parent. -
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. -
The text should be centered, so set
text-align: center
on thebody
- the children ofbody
will inherit the value, so you do not need to set it anywhere else. -
Remove
background-color
on.textbody
- it is not needed, and needs a value if it is. -
On the image, add
display: block
andmax-width: 100%
- the max-width prevents it from overflowing its container.
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