Why do fonts on web pages sometimes appear differently in IE and Opera?
Web pages do not always specify a specific font. Instead they allow the browser to choose a font for a specific task (e.g. section headings, links etc.). There is no standard as to what those fonts should be. Even where fonts are specified explicitly, it is posible that such a font is not available on a particular computer. It is left up to the browser to decide on the fallback position in such a case.
It’s quite true that in the absence of an explicit font-size definition, a browser defaults back to some size written into the program. Body text is pretty-well standardized these days (at about 16 px or 12 pt), but different browsers still render headers (HTML <h1>, <h2>, etc. tags) at different sizes. Unstyled headers on Internet Explorer will look about 25% bigger than the same headers on Mozilla, which in turn look slightly bigger than unstyled headers rendered with Opera.
However, Opera has some issues with even explicitly-styled text. I noticed last year while working on a site (http://www.rit.edu/~cabwww/springfestival/) that text specified at 75% of normal body size looked noticeably smaller on Opera than on any other browser. As an experiment, I went into Opera’s menu and tweaked the default font-size up to 13pt (instead of 12pt). Voila, it worked fine. However, I couldn’t count on all my Opera-loving users to do the same.
Eventually, while working on another project I discovered that if I increased the font-size from 75% to 76%, Opera would render the text the same as on every other browser. This seems to stem from some rounding issue. No matter what units a font-size is specified in, the browser has to eventually display it using pixels. Where IE, Mozilla, Netscape, Safari, and every other browser I can think of round up to the next pixel, Opera rounded down.
I remember from elementary school that if a number to be rounded is from 0 to 4.999999~, you round down, and if it’s higher than 5, you round up. Maybe in Norway (where Opera was written) the custom is 0-5 down, 6+ up. Can anybody confirm or deny that?
0.5 is rounded up here as well :). More likely, there’s a bug in Opera. 75% of 12 is 9, so there shouldn’t be any rounding involved at all.