Bobby Jack wrote:
> It turns out that Aem + Bem != (A+B)em - at least, at certain 
> font-sizes - which is incredibly frustrating. Does anyone have a good
>  way of working around this and/or an idea of the scope of the 
> problem?

Browsers don't agree on at what point rounding of font-sizes in
percentage or em into px should be rounded up or down, so the
rounding-problems start already there.

Where, and how, dimensions declared in em should be rounded - if at all,
is left to browser developers. Some spread there.

> I've put up an example at 
> http://www.fiveminuteargument.com/width-in-ems . In my version of 
> IE7, 90% and 70% suffer from the problem.

For cases involving floats (like your test-case) I usually solve such
problems by leaving "bug-space".
That is: I don't apply backside margins on floats unless absolutely
necessary, with the effect that those "side-by-side" floats won't
interact and run out of space even when there's pretty extreme rounding
errors or calculation bugs.

In elastic layouts - which I don't create very often - I get the elastic
effects by only applying width in em on the outer container and in
percentages on the inner ones and their margins. Browsers seem to round
percentages slightly more consistent than they do em, and dimensions and
spaces for inner containers will divide up the space in the outer one
pretty closely.
I then leave "bug-space" where the actual design allows, thus avoid
rounding problems by avoiding designing in tight corners.

My pragmatic conclusion is that "a space looks like a space", even if it
isn't declared and/or is one or more pixels off its intended width.

regards
        Georg
-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to