Reminder: Cross browser font sizes
I'm sure most of you have already read the excellent experiment on font sizes but it's important enough to summarice here.
The problem is how to make as many browsers as possible display fonts in the same size, without using pixels or other absolute units. Why shouldn't you use fixed font sizes? Because they make Internet Explorer unable to zoom the text with text-zoom, something that's bad for accessibility.
When you start experimenting with this problem you quickly get into problems. I tested in Firefox 1.5, Internet Explorer 6 and Opera 9 and it was incredibly hard (Want a challange? Don't read on, try it by yourself) even with just those few browsers. Opera has problems with units it seems. If you use em:s you can't use more than two decimals, Opera will round it them differently than the others.
Anyway, Owen Briggs solved this for us in a very simple way:
/* Set the size in percent on the body */
body { font-size: 76%; }
/* All other sizes should be in em units with maximum of one decimal */
p { font-size: 1em; }
h1 { font-size: 2em; }
h2 { font-size: 1.8em; }
From my simple tests it seems to work fine. Did you know?
Comments
By: Emil Stenström (#1)
(I was able to restore it from another open tab but the comments are gone)
By: Jesper Rønn-Jensen (#2)
My rationale: If Eric Meyer uses it, there is probably a reason as to why it's put in that way.
Thanks for pointing me to Owen Brigg.
By: Emil Stenström (#3)
By: Joel Birch (#4)
I often wonder why this method is rarely mentioned in these discussions.
By: zcorpan (#5)
By: Dork (#6)
http://developer.yahoo.com/yui/fonts/
By: Marko (#7)
I am not sure if this is best way but works fine for me.
By: ppo insurance unity empire health (#8)
By: eric (#9)
So I continue to scour the net for a technique that will allow me to reliably take a designer's pixel- or point-based size and render it in -- well, anything. I'd settle for bloody pixels, if they worked. They don't. (They never have, actually. I proved it eight years ago by doing screenshots in IE, Netscape and Opera across different system font sizes and screen resolutions. Pixels were the least consistent of the three methods I tried (points, percentage and pixels). Pixels weren't pixels then, either, it just wasn't as crazy as it is now.)
I'm sure you all think I'm a crank by now, but the thing is, I've been driven a little insane by all of this.
By: Emil Stenström (#10)