Working with em font sizing?

Associate
Joined
12 Aug 2004
Posts
1,009
Location
Glasgow, Scotland
Hey :)

Just trying to get my head around how em font sizing works :confused:

I'm using 10pt arial as my standard font, so if I put 2em this creates the same effect ... fair enough ... but I also have some fonts at 8pt ... so I put 1em and it's coming extremely tiny... as in size 4pt or 6pt? , i tried putting in 1.5em, 1.7em etc. thinking this would sort it but it just isn't budging :confused:

I heard that em font sizing was relative to the first font size you put in ... so I tried putting in 2em as the first font, then either 100%, 50% or 200% as the other sizes but this just mucks it up completey.

Is there a way I should be using the em sizing system properly?
 
I think it's just a way of working that you get used to. I always start with the 62.5% trick to make things easier to digest if you're using it for layouts - being that 1em will typically equate to 10 pixels.

Then you just need to remember that a child will inherit the parent element's font-size i.e. the child element's text will be relative to the parent's size if you start adjusting it.

I tend to just go with the rough ballpark figure I'm after for an element, and then just increase or decrease the value as necessary; too much effort to start getting into the maths of it :D.
 
Back
Top Bottom