IE difficulties: font size rounding

Tuesday 18 November 2003

More web design minutia: The second difficulty (see previous blog entry) I was having with IE had to do with font sizing, but I finally solved it.

When I adjusted the font sizes in nested elements, the results would be different for IE and Firebird. I thought it had to do with CSS bugs dealing with nested contexts, but none of the CSS references mentioned it.

Poking around the we’re-not-worthy css-discuss wiki, I stumbled upon the answer on the UsingEms page. The browser difference is in the rounding of font sizes, and which result of rounding is used for further computations in nested contexts. It turns out you can trick the browsers into identical algorithms with this rule:

body { font-size: 101% }

Now the text on this page is the same size in IE as it has been for months in Mozilla. At last!

Comments

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.