is there still any benefit to using em or rem in media queries? can't we just use pixels now?

?
16 Replies
13eck
13eck2y ago
You should always use em for media queries. Always https://zellwk.com/blog/media-query-units/
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 a
Aozen
Aozen2y ago
the article explains why right?
13eck
13eck2y ago
Yes Basically browsers support em most, and pixels should never be used
Aozen
Aozen2y ago
i 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)
13eck
13eck2y ago
You should never use pixels for anything except for visual flourishes: borders, border radius, horizontal rule, etc
Aozen
Aozen2y ago
thank you very very much in the article he referenced what i was confused about
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
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
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
13eck
13eck2y ago
He's got all the code he used in the article. Feel free to make a codepen and play around with it
Aozen
Aozen2y ago
oh
Aozen
Aozen2y ago
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 ...
Aozen
Aozen2y ago
oh wait he shows that in the video too that i was watching
13eck
13eck2y ago
hah! there it is lawl
Aozen
Aozen2y ago
sorry if i used your time XD i just wanted to know but will read the article now
13eck
13eck2y ago
https://tenor.com/bWAuG.gif [the more you know]
Tenor
Aozen
Aozen2y ago
i appreciate the help ^^ i go back to my bing youtubing kevin channel XD
13eck
13eck2y ago
Of course!
Aozen
Aozen2y ago
u still here?