@Islandstone89
Posted
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 a page's "main" section. Change.wrapper
into a<main>
, and move the<footer>
outside of the main. -
Remove the
.clearfix
div, it is not needed. -
I wouldn't use
<figure>
for the image - that is used when we want to include a caption underneath the image. Here is some more info about the<figure>
element. -
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."
-
Headings should always be in order, so you never start with a
<h3>
. I would change it 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.
-
I like to add
1rem
ofpadding
on thebody
, to ensure the card doesn't touch the edges on small screens. -
Remove the styles on
.wrapper
, it doesn't need any styles. -
On the
body
, changeheight
tomin-height
- this way, the content will not get cut off if it grows beneath the viewport. Removeoverflow
,width
,max-width
andmargin
, none of those are needed. Addflex-direction: column
andgap: 2rem
. -
On the card, you need to add
display: flex
forflex-direction
andalign-items
to work. -
Remove all widths and heights 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. -
letter-spacing
must also never be inpx
. You can useem
, where1em
equals the element's font size. -
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. -
Paragraphs have a default value of
font-weight: 400
, so there is no need to declare it. -
On the image, add
display: block
andmax-width: 100%
- the max-width prevents it from overflowing its container. Remove themargin
, except formargin-bottom
. -
To create the space between the image and the edge of the card, set
padding
on all 4 sides of the card::padding: 16px;
. -
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.
Marked as helpful
@lola-ilori
Posted
@Islandstone89 Thank you so much for the detailed feedback. Very much appreciated. I'll adjust my code accordingly.