@Islandstone89
Posted
HTML:
-
Remove
role="contentinfo"
- this is the implicit role for a<footer>
element, which you don't have. -
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 a page's "main" section. Wrap the card in a<main>
. -
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(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.
CSS:
-
Including a CSS Reset at the top is good practice.
-
Use the style guide to find the correct
font-family
, and remember to specify a fallback font:font-family: 'Outfit',sans-serif;
-
I like to add
1rem
ofpadding
on thebody
, to ensure the card doesn't touch the edges on small screens. -
Remove all positioning and transform properties.
-
On the
body
, removeheight
. -
To center the card horizontally and vertically, I would use Flexbox on the body:
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100svh;
-
Remove all widths in
%
. -
max-width
on the card must be in rem. I would set it to around20rem
. -
font-family
should be set on thebody
, and removed elsewhere. The children of thebody
will inherit the font from their parent. -
letter-spacing
must not be inpx
. You can useem
, where1em
equals the element's font size. -
I like to add
text-wrap: balance
on headings - this ensures, as per MDN, that "text is wrapped in a way that best balances the number of characters on each line". -
On the image, add
display: block
andmax-width: 100%
- the max-width prevents it from overflowing its container. Without this, an image would overflow if its intrinsic size is wider than the container.max-width: 100%
makes the image shrink to fit inside its container.
Marked as helpful
@bakellian
Posted
@Islandstone89 thank you so much! extremely helpful