Design comparison
Solution retrospective
When to use max-width or min-width?
Is using rem are good for font-size and em for margin and padding and I always guessing to use a unit size.
Community feedback
- @Yehan20Posted over 2 years ago
Max width means , the element you assign it will not grow its width more than that , unlike the normal width max width can shrink as the viewport decreases , so its responsive while a normal width in pixels wont do that , min width means , the element cannot get smaller than this value , so if you want a particular element not so shrink at a particular width you can use a min-width,
Rem's and Em's are relative units , using ems for margin and padding it will change with the font size of that particular element , for example you have button of font size
1.5rem and padding 0.75em
as you increase font size padding will increase , i recommend watching this
video.I hope this helped ,
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