@weldu0
Posted
π Hey, @starberries! To answer your question, use rem
for most cases and px
only when specifically required.
If youβre not familiar with rem
or em
, try getting into these units because they are much better than px
. To convert from px to em:
- 1em is typically equivalent to 16px (assuming the default font size).
- To convert pixels to ems, divide the pixel value by 16 (px / 16 = em).
Regarding fixed width/height, there are times when you need them, but for containers like in this case, use max-width
and max-height
instead.
You can read more about the units here.
Very good course about responsive by Kevin Powell
Like you said, you did very well. Great work! π
I hope you find this helpful. π
Marked as helpful
@starberries
Posted
Thanks a lot for the advice, @weldu0! I actually didn't even realize rem
/em
were applicable to sizes beyond font as well, so that's immensely helpful alongside utilizing max-height
/max-width
, greatly appreciated!
@weldu0
Posted
You're welcome! I'm glad to hear that it was helpful. @starberries