简体   繁体   English

IE9:错误呈现Arial(更大胆)

[英]IE9: wrong rendering of Arial (bolder)

I've tested my page in Chrome, FF and IE8 and all the browser render the text this way: 我已经在Chrome,FF和IE8中测试了我的页面,所有浏览器都以这种方式呈现文本:

在此输入图像描述

It is defined like: 定义如下:

font-family: 'Arial', sans-serif;
font-size: 0.75em;  
font-weight: bold;

I've tried declaring Arial in different ways, using px instead of em and also define the weight in number (600, 800)... But IE9 still renders is "bolder" than the other browsers: 我尝试用不同的方式声明Arial,使用px而不是em,并且还定义了数量(600,800)...但是IE9仍然呈现比其他浏览器“更大胆”:

在此输入图像描述

Any help? 有帮助吗? Thanks 谢谢

You might have a different problem, since you said you tried a weight of 600 , but generally, when you tell IE 9 to render Arial as bold, what you end up seeing is not Arial , but Arial Black . 你可能有一个不同的问题,因为你说你尝试过600的重量,但一般来说,当你告诉IE 9将Arial渲染为粗体时,你最终看到的不是Arial ,而是Arial Black This switch will happen for font-weight s of 800 and 900 . 对于800900 font-weight s,将进行此切换。

To have a bold Arial in IE 9 without switching to Arial Black , use... 要在IE 9中使用粗体Arial而不切换到Arial Black ,请使用......

font-family: Arial, sans-serif;
font-size: 0.75em;  
font-weight: 700;

This should also address the same issue in Firefox. 这也应该解决Firefox中的相同问题。

This question has been answered on StackOverflow before. 这个问题之前已经在StackOverflow上得到了解答 It's a browser issue, IE9 renders fonts different. 这是一个浏览器问题,IE9渲染字体不同。 It uses a ClearType technique called DirectWrite. 它使用名为DirectWrite的ClearType技术。

In my personal opinion, this isn't a big problem. 我个人认为,这不是一个大问题。 Websites never look absolutly similiar in every browser. 网站在每个浏览器中都不会看起来绝对相似。 If it really bothers you, it's possible to add IE-Hacks (eg force the browser to use IE8-rendering) but I wouldn't recommend it. 如果它真的困扰你,可以添加IE-Hacks(例如强制浏览器使用IE8渲染),但我不推荐它。

Just to weigh in, you could place a meta tag into your HTML as a quick workaround, which will tell IE9 to emulate IE8, bringing back the original rendering. 只是为了权衡,您可以将一个元标记作为快速解决方法放入HTML中,这将告诉IE9模拟IE8,带回原始渲染。

To do this, place <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> in your section. 为此,请在您的部分中放置<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

However this will come at the expense of other IE9 features you may need, like the better HTML5 and CSS3 support. 然而,这将以您可能需要的其他IE9功能为代价,例如更好的HTML5和CSS3支持。

IE in general tends to give me headaches. IE通常会让我感到头痛。 What I would do is use conditional CSS and remove the bold from the IE css 我要做的是使用条件CSS并删除IE css中的粗体

<!--[if IE 9]>
    <link rel="stylesheet" type="text/css" href="/ie9.css" />
<![endif]-->

And then define it like this 然后像这样定义它

font-family: 'Arial', sans-serif;
font-size: 0.75em;  

I came across this issue when I accidentally set the font-weight:bold on the body tag. 当我不小心在body标签上设置font-weight:bold时,我遇到了这个问题。 For some reason IE9 rendered all my Arial text bolder than other browsers. 出于某种原因,IE9使我的所有Arial文本比其他浏览器更大胆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM