Recently, I've rewritten the CSS file for a site I'm making and tried to make most elements and fonts dynamic in size using em instead of px. The sizes work.. kind of, but there's at least one issue.
When using the em unit for the margins of a box (margin: 0.25em), in Firefox I get 4px at the top/left and 3px at the right/bottom - based on 14px font-size (which is actually the box's font-size 0.875em of the browser's 16px).
Now, I'm new to em and it's quite possible that I've misunderstood several things but using my understanding, I'm thinking that 0.25em of 14px is 3.5px. If this is the case, and rounding is the cause of 4 or 3 pixels in the margins, is this really how it's supposed to work? A certain calculation with a rounded result should round the exact same way every time, no? Also, in Internet Explorer, it's the exact opposite: top/left are 3px and right/bottom are 4px.I tried changing the value to 0.286em (x 14px -> 4.004px) to avoid ending up at exactly half a pixel and this turns out as 4/4/4/4 in Firefox but 4/3/4/3 in IE.
Other than these pixel errors, changing the browser font-size actually scales everything very nicely.
Am I crazy, have I misunderstood something, are both browsers broken or.. what? (Used IE8 and FF3 and 19.)