Design comparison
Solution retrospective
Proud that I managed to complete it but I hope to do better next time.
What challenges did you encounter, and how did you overcome them?I didn't consider the height of the element and thus everything was stuck to the top, but a few minutes re-checking things made it clear.
What specific areas of your project would you like help with?Not sure at the moment.
Community feedback
- @Islandstone89Posted 6 months ago
Hello, good job!
Here are some suggestions I hope you find helpful!
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."
-
Do not use
<br>
to force text onto a new line. The text should flow naturally, and all styling, including space between elements, should be done in the CSS.
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. -
Remember to specify a fallback font:
font-family: 'Outfit', sans-serif;
. -
Fonts, and other typographic properties, get inherited by the children of the element you put it on. Place it on the
body
, and remove it elsewhere. -
On the
main
, changeheight
tomin-height
- this way, the content will not get cut off if it grows beneath the viewport. -
Remove ALL widths in
px
. We want our components to be able to adapt to all kinds of screens, hence setting fixed sizes inpx
is not recommended. -
Add a
max-width
of around20rem
on the card, to prevent it from getting too wide on larger screens. -
Add
flex-direction: column
on the card. -
Remove
flex-wrap
, it is not needed. -
The padding should be equal on all sides of the card, so you can write it like this:
padding: 20px
. -
I would use
rem
instead ofem
forfont-size
. And never usepx
, as that prevents the text from scaling if a user changes the default font size in the browser. -
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. Removealign-items
andjustify-content
- these do not work without declaringdisplay: flex
, which you do not need here. -
Remove
align-content
on.container
, it is not needed. -
As the design doesn't change, there is no need for any media queries. When you do need them, they should be in rem, not px. Also, it is common practice to do mobile styles first and use media queries for larger screens.
Marked as helpful0@vallkrePosted 6 months ago@Islandstone89 Thank you so much for the suggestions! I've read through them a few times and definitely learned and realized a lot of things that I hadn't considered before especially everything about units and how using px and other absolute units is not the best. Will try and implement them in the future challenges/projects I undertake. Thank you once again!
1 -
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