Open burgwyn opened 6 years ago
Here's some advice I've gotten on the em
vs rem
vs px
stuff:
Typically I use
rem
for font-related sizing, becauserem
is derived from thefont-size
set onhtml
. That font size is usually10px
at 18F (so1.6rem
==16px
). I always want anh3
to be the same, regardless of the size of its parent element’sfont-size
, so this works well for that application.OTOH,
em
sizes are relative to their parent containers’font-size
. I useem
for things like margin and padding, so that I can set them relative to the current font size instead of setting them to an absolute value. This helps with resizing things responsively and when the user zooms, because changing a font size of an element should also change margin/padding/etc. It’s definitely not a perfect trick, but it works pretty well for a lot of things.
border-radius
media
breaksz-index
rem
vspx