Chrome不尊重字体重量? [英] Chrome not respecting font weight?

查看:89
本文介绍了Chrome不尊重字体重量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Arial作为我的基本字体,我试图对页面的不同部分使用各种字体权重(正常,粗体/ 700和900)

I've got Arial as my base font and I'm trying to use a variety of font-weights for different sections of the page (normal, bold/700, and 900)

这似乎在Firefox和Internet Explorer中工作正常,但是在Google Chrome中,粗体/ 700和900之间似乎没有什么区别?

This seems to work fine in both Firefox and Internet Explorer, but in Google chrome there seems to be absolutely no difference between bold/700 and 900!?

查看小提示

(上述链接已损坏/无效)

(incase the above link is broken/invalid)

HTML

<p id="one">Testing</p>
<p id="two">Testing</p>
<p id="three">Testing</p>

CSS:

p { font-family: arial; font-size: 40px; margin: 0; }

#one { font-weight: normal; }
#two { font-weight: 700; }
#three { font-weight: 900; }

我google了一下,发现了一个类似问题,它提供了一个半有用的答案:

I've googled a bit and found a similar question which provides a semi-usefull answer:


解决:

Solved with:

font-weight:900; font-family:Arial Black,Arial,sans-serif;

font-weight: 900; font-family: "Arial Black", Arial, sans-serif;

但是使用上面的简单方法, $ c> font-weight 在Chrome中为900(即使另有规定)

But using the above simple makes everything assume a font-weight of 900 in Chrome (even when specified otherwise)

有关在这里(显然在Chrome中)

For an example of this see here (in Chrome obviously)

这是Chrome中的错误吗?

Is this a bug in Chrome? Or am I doing something wrong here?

推荐答案

Arial(至少标准版本)只有两个权重:正常粗体。如果您指定的权重不是这两者之一,浏览器将选择最接近的可用权重。 (请参阅: font-weight:900 only working in Firefox

Arial (at least the standard version) only has two weights: normal and bold. If you specify a weight that is not one of those two, the browser will pick the closest available weight. (See: font-weight:900 only working in Firefox)

Arial Black是Arial的独立字体,这就是为什么您提供的半有用答案的原因。

Arial Black is a separate font from Arial, which is why the semi-useful answer you provided works.

想要与Arial一起工作,请尝试:

If you want to work with Arial, try:

#one { font-weight: normal; }
#two { font-weight: bold; }
#three { font-family: "Arial Black", Arial, sans-serif; }

另一种方法是使用typekit或Webink等webfont服务,可用重量。

The other alternative is to use a webfont service like Typekit or Webink, and pick a font with more available weights.

这篇关于Chrome不尊重字体重量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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