tags:

views:

27

answers:

1

I used to use the 'font-sizes in ems' approach (mostly for IE users) and some CSS hacks to have the same font size on systems where screen is set to 120dpi. I know that forcing the same font size in 120 dpi is not good in usability terms, but this is the way I should get it done.

I'm curious is it good to switch to pixels instead of ems, as far as I see all my target browsers (IE7,8; FF 3.6, Chrome 5, Opera 10.6, Safari Win) support full page zoom.

I have the following restrictions:

  • No IE6 support
  • Font size should be the same in 96dpi and 120dpi (I usually have many graphics that requires that text should be in some particular size).

Should I switch?

Thanks in advance!

+1  A: 

I generally recommend to stick w/ em- or %-based font-sizes to avoid headaches related w/ the pixel based approaches. However, you might want to use px for the base font size and adjust it w/ CSS3 media queries to your needs (particularly querying for the resolution should help you).

The downside of this method is that, as so often, IE 7 and 8 will need yet another hack as IE is the only browser in your list currently not supporting media queries. hth & good luck!

Gerald Senarclens de Grancy
Currently I use 'ems' + some fixes for 120 dpi on Windows (special hacks for IE and media queries for all other browsers).If I use pixels, will the text be the same in 120dpi without hacks?What are headaches you mentioned?
artvolk
Could you be a bit more specific about "the same"? A pixel's size (in mm or inch or the like) depends on the resolution and the size of a screen.
Gerald Senarclens de Grancy
The same I mean in px, because the graphics remain the same size in px.
artvolk