• The Cobalt Apps Community Forum is for community interaction and assistance, but is not our official Cobalt Apps Product Support solution. If you need Cobalt Apps Product Support please contact our support team through the contact form found at the bottom of your "My Account" page.

Media Queries in em

#1
Heya,

I have a question in regard to the media queries in Freelancer as I notice they are in em.
This is new to me so I was wondering how this is calculated?

Is this in relation to the main font size or container size etc?
If so, if you change the main font size does this throw everything out?

And also - if I wish to change a media query - say from 1024px (64em) to 1000px, how would this be calculated?

Hope I'm making sense and you understand my confusion! ;)

Cheers,

Brett
 

eric

Administrator
Cobalt Apps Developer
#2
EM-based media queries are based on the internal browser font size which is generally 16px, but you can basically use that number regardless of the browser or font-size settings. So 64em X 16px = 1024

So if you wanted to change from 1024 to 1000 it would be 1000 / 16 = 62.5em

This article is helpful in explaining the reasons behind EM-based media queries vs px or REM: https://zellwk.com/blog/media-query-units/
 
#3
Ah Cheers Eric...!!

Internal "BROWSER" font size!

I was thinking it was working in relation to the site body font size!
So I was changing the main site font size and still getting the same responsive results - and of course confusing myself!
Duh!!

All good! I am completely following now!! heh..

Been using just px for far too long.

Thanks! Appreciated...

Brett