如何让字体在所有浏览器中正常显示? [英] How do I get font to display properly in all browsers?

查看:127
本文介绍了如何让字体在所有浏览器中正常显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站的CSS文件中有以下内容:

I have the following in the CSS file for my website:

body {
font-family: Georgia, "Times New Roman", serif;
font-size: 1.125em;
line-height: 1.5em;
}

在Mac上的Safari中,网站的字体看起来像我想要的:

In Safari on my Mac the site has the font looking the way I want it:

但是,在IE和Chrome上的Windows计算机上,字体看起来不像上面所示,请参阅:

However, on Windows computers in IE and Chrome the font does not look like the above, see:

我的问题是,如何让所有的浏览器看起来一样的字体看起来像上面的截图#1?

My question is, how do I get the font to look the same in all the browsers on all OS such that looks like screenshot #1 above?

先感谢您的帮助。

推荐答案

这是一个平滑的问题,到另一个,他们不以同样的方式读字体。

This is a matter of foont smoothing and that is different from a browser to another, they don't "read" fonts the same way.

这里是一个解释过程,字体平滑说明

Here is an article that explains the process, Font smoothing explained.

这里是一个CSS黑客尝试为了得到相同的结果无处不在:

and here is a CSS hack you can try in order to get the same result everywhere:

html, html a {
    -webkit-font-smoothing: antialiased;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
}

进一步阅读:

Further reading: 4.2 Font smoothing: the 'font-smooth' property in the CSS 3 fonts module specs from the W3C

这篇关于如何让字体在所有浏览器中正常显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆