Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] EMs for media queries and layout Reply To: EMs for media queries and layout

#150307
Larry
Participant

No need to use rem’s for media queries – the value em’s obtain is that of the user agent, and not from your styles: http://www.stephanmuller.nl/ems-relative-media-queries/

I’ve used em’s with the assumption that 1em ~= 16px in media queries for a while now. I discovered this after being baffled as to why my breakdpoints weren’t working, and eventually discovering that no matter what I had set my base font size to, media queries were consistently being calculated at +-16x the value of the em in the media query.

Don’t worry about fallbacks – just use em’s for media queries, and use rems as you’d want everywhere else.