PX, EM or REM Media Queries?
Published on:Have you wondered if you should use px
, em
or rem
for media queries? I had the same question too, and I never figured it out, not till now.
When I first created the mappy-breakpoint library, I used rem
units. Then after a conversation with Sam Richard, I quickly switched to em
instead because I found out there isn't a difference between the two.
In addition to em
and rem
, a popular unit of choice for media queries is the good old pixel. I wondered if it's possible to use pixel queries nowadays since px-zooming problem that used to exist was now resolved by all browsers.
This week, I finally decided to get to the bottom of this matter.