Design comparison
Solution retrospective
i think i got pretty close to the provided design
What challenges did you encounter, and how did you overcome them?remembered the box model and had to go read up on how to account for padding in the width/height of containers (it was box-sizing: border-box btw)
What specific areas of your project would you like help with?had a little trouble figuring out the spacing between the qr code and the text but i guess there was no special spacing involved anyways
Community feedback
- @Islandstone89Posted 6 months ago
HTML:
-
The alt text must also say where it leads(frontendmentor website). A good alt text would be "QR code leading to the Frontend Mentor website."
-
Never have text in divs alone. "Scan the QR code" is a
<p>
, and it doesn't need to be wrapped in a div.
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
width
andheight
on the card. You should rarely set fixed sizes inpx
. -
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. -
Paragraphs have a default value of
font-weight: 400
, so there is no need to declare it. -
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
andmax-width: 100%
- the max-width prevents it from overflowing its container.
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