Design comparison
Solution retrospective
Q. here should px
units be avoided. My mobile design was perfect but when I started to work on desktop design I had to rewrite all margin and padding values, I wished I had used rem
for them. Which one is better??
Community feedback
- @imadvvPosted over 2 years ago
Salam Moahamad!!, Mabrouk completing Your challenge!,
The
px
unit is something that gets you started very easily, but it turns into a problem later down the road This article has more details about why you should avoid usingpx
over author units.but in general I think is each has his one use case, for controlling Layout and font size I think
rem
unit along side withmax-width
, and for controlling the width of textch
units make best option as is relative to character , and for controlling elements inside acomponent
I usually go with%
, case the component controlled by layout ,and letpx
for things likeborder-width
or some decorativePseudo-elements
stuff like that.but over all, Hope this Help! and correct me if am wrong, am in process of learning too,
have a Good Week
Marked as helpful1@mbilal-xPosted over 2 years ago@imadbg01
Thanks so much Imad.
This really helps. you summarized it all. and can you please share that link to the article again, it's not working. Thanks 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