is there still any benefit to using em or rem in media queries? can't we just use pixels now?
?
16 Replies
PX, EM or REM Media Queries? | Zell Liew
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 athe article explains why right?
Yes
Basically browsers support
em
most, and pixels should never be usedi heard that all browsers now have made a way to like have a common pixel size so i thought since safari now technically does not have a difference pixels would be okay to use
but ofc i am asking here cs i am unsure ( but explaining why i got this idea)
You should never use pixels for anything except for visual flourishes: borders, border radius, horizontal rule, etc
thank you very very much in the article he referenced what i was confused about
it seems i was confused about that pixel zooming
is there a way to see the differences visually?
maybe any video of people testing it
He's got all the code he used in the article. Feel free to make a codepen and play around with it
oh
Kevin Powell
YouTube
Are you using the right CSS units?
There are a lot of different units that we can use when writing CSS, in this video I give some general rules of thumb of which ones are best suited for which situations.
Zell's article on media queries: https://zellwk.com/blog/media-query-units/
Em vs. Rem: https://youtu.be/_-aDOAMmDHI
Using clamp() for fonts: https://youtu.be/U9VF-4euyRo
The ...
oh wait he shows that in the video too that i was watching
hah! there it is
lawl
sorry if i used your time XD i just wanted to know
but will read the article
now
https://tenor.com/bWAuG.gif
[the more you know]
i appreciate the help ^^
i go back to my bing youtubing kevin channel XD
Of course!
u still here?