Design comparison
Community feedback
- @Islandstone89Posted about 2 months ago
Hi, good job. Here are some tips to further improve your solution!
HTML:
-
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."
-
Change
.footer
from a<div>
to a<footer>
, and move it outside of<main>
. -
Wrap the footer text in a
<p>
.
CSS:
-
Including a CSS Reset at the top is good practice.
-
Use the style guide to find the correct
background-color
and the correctfont-family
. -
I would recommend adding
1rem
ofpadding
on thebody
, to ensure the card doesn't touch the edges on small screens. -
You don't need to have
margin: 0
on thebody
when it is already set on all elements using the universal selector*
. -
I would move
font-family
tobody
. -
text-decoration: none
could be set on links, but it doesn't make too much sense to set it on all elements since that is the default value of most elements. -
On
body
, addflex-direction: column
andgap: 2rem
. -
I would move the styles on
main
to the<div>
that holds the card content - the main doesn't need any styles. -
max-width
on the card should be in rem. Around20rem
will work fine. -
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. -
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. -
On the image, add
display: block
and changewidth
tomax-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. -
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. Also, it is common practice to do mobile styles first and use media queries for larger screens.
Marked as helpful0 -
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