Design comparison
Community feedback
- @Kaloyan-KostovPosted 3 months ago
Good job, I really like your solution, so keep on with the good stuff!
1 - @Islandstone89Posted 3 months ago
Hey, well done :)
Here are some suggestions to improve your solution even further:
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. Wrap the card in a<main>
. -
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."
-
"Improve your" is not a paragraph, but a heading. Headings should always be in order, so you would usually start with a
<h1>
. The<h1>
represents the main heading on a page, and should not be repeated. As this is a card heading, it would likely not be the main heading on a page. Hence, making it a<h2>
makes the most sense to me.
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. -
On the
body
, changeheight
tomin-height
- this way, the content will not get cut off if it grows beneath the viewport. -
Remove the
width
andheight
inpx
on the card. We rarely want to constrain the dimensions of a component, as we want it to grow and shrink according to the screen size. -
We do want to limit the width of the card, so it doesn't get too wide on larger screens. Give the card a
max-width
of around20rem
to solve this issue. -
On the image, add
display: block
and changewidth
tomax-width: 100%
- the max-width prevents it from overflowing its container. -
Instead of setting
font-family
on both the heading and paragraph individually, you can put it on thebody
, and remove it elsewhere.font-family
, like most typographic properties, inherits, meaning their value gets passed down to the descendants of the element it is declared on.
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