Design comparison
Solution retrospective
I tried using variables in a good way by extracting things such as border-radius, colors, etc. to reduce repetition. I also used the <picture>
tag to avoid having to load images that are not supposed to be loaded, i.e. if mobile we only load mobile image and so on.
I also tried using rem, em in a good way, but I am still struggling to figure out when to use which. I guess em for margins and rem for fonts?
Community feedback
- @Mr-jawPosted almost 2 years ago
Hello there
Yes, we mostly use
em
for paddings, margins and for dimensions, Andrem
for font sizes. It is not mandatory. we can userem
for margins, paddings Andem
for font size as well. But the different betweenrem
andem
is;em
depends on parent font size andrem
depends on html declared font sizeLearn more about it here
Also, if you want to learn more about other CSS units CSS units
I hope this was helpful 😊
Marked as helpful1
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