Why is IE9/Firefox showing a different font size in relation to other browsers?

拟墨画扇 提交于 2019-12-01 15:18:33
thirtydot

IE9 uses DirectWrite to render text, and other browsers do not (except for Firefox 4+).

That is the reason for the slightly different size of the text between the two browsers.

There is no way to make the text the same size.

Read this: http://www.basschouten.com/blog1.php/font-rendering-gdi-versus-directwrite

And this, particularly the "Hinting and spacing differences" section: https://web.archive.org/web/20120603023828/https://blog.mozilla.org/nattokirai/2011/08/11/directwrite-text-rendering-in-firefox-6/

Durer

Try to set the body{font-size:medium; line-height:1em;} where the font-size will be of 16px now and use percent on p tag to increase or decrease the font-size. To be sure of limit the width of the p tag.

P{max-width:40%; font-size:86%; line-height:1.2em;}

Two possible things, both untested:

  1. try changing the doctype to something other than xhtml transitional. See if the HTML5 doctype renders it better. <!DOCTYPE html>

  2. try using only font-family: monospace; to see if it is a font issue.

EDIT

If those do not work and you cannot find a solution, you might want to serve IE9 a different font-size using conditional comments.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!