Ryk:
This may help in the understanding of ems - it certainly helped me!
An em is roughly the width of a lowercase "m" in a font and using a browser's default internal stylesheet, am em is roughly equivalent to 16 pixels.
Setting the font-size attribute in the body tag to 62.5% (as in the default stylesheet for ZC 1.3) makes one em roughly equivalent to 10px...making it a lot easier to equate ems to pixel sizes e.g. 1.2em will be 12px, 9px will be 0.9em.
Or near enough!Everything Ryk says is spot on, but there is an additional wrinkle to watch out for. Unlike pixels which are absolute, ems are inherited. OK, what doies that mean in plain English? Well, if you apply a font-size in ems to the text in a div, then nest another div inside and give that a font size in ems too, the results may be rather different to what you expected.
For example, suppose you wanted to create some larger text and so set the font size for your div to 2em. You then nest another div inside and want the text there to be 2ems too and so set a CSS font size for the nested div to be 2em also. NOOOOO. What you will get is a font size of 2 x 2 = 4ems because the inner div also inherits the font size styling for the outer div. You can see this in practice here.
So the moral of this story is use ems for text sizes, but set them only when you want to change the size and bear in mind any other changes already made higher in the div hierarchy.
Of course, this poses a second question. If they're so damned tricky, why use them at all? At least we know where we are with pixels! We like ems for reasons of accessibility and cross browser compatibility. Unlike pixels, everybody handles ems in the same way. The biggest drawback of pixels is that IE treats them differently to everybody else when the user decides to change foint size. For example, people with poor eyesight may choose to display all text larger, sometimes very much larger. IE won't let them if the text size is defined in pixels. Whereas ems scale nicely in all browsers and if you define the stuff around your text in ems too, it is possible to design sites that keep much of their shape even when dispalyed at several times the intended text size.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)