所有CSS font-weight属性的值是否有用? [英] Are all CSS font-weight property's values useful?

查看:377
本文介绍了所有CSS font-weight属性的值是否有用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

font-weight:normal
font-weight:bold
font-weight:bolder
font-weight:lighter
font-weight:100
font-weight:200
font-weight:300
font-weight:400
font-weight:500
font-weight:600
font-weight:700
font-weight:800
font-weight:900


$ b b

我只使用 font-weight:bold ,有时使用 font-weight:normal 至今。

我创建了这个示例页面,其中包含了属性的所有值,但是其中许多值没有太大区别。

I created this example page with all the values for the property, but there's not much difference in many of them.

http://jsbin.com/omaha3

推荐答案

如果你显示的字体有更多的权重,如半粗体,光等,浏览器可能能够呈现这些权重,如果你使用其中一个数值。大多数最终用户字体只有两个或三个样式,但我不认为这是非常适用于现实世界。我将依靠正常(= 400我认为)和粗体(= 700)。

If the font you are displaying has more weights like semi-bold, light, etc. the browser may be able to render those weights if you use one of the numeric values. Most end-user fonts come with two or three styles only, though, so I don't think this is much applicable to the real world. I would rely on normal (=400 I think) and bold (=700) only.

W3C reference on font-weight:bold

更新:以下是 深入博客 了解如何在现代浏览器中呈现样式。它的标题是除了一个浏览器,字体仍然打破:)

第二次更新:由于clagnut.com遭遇灾难性的数据这里是已归档的帖子

Update: Here is an in-depth blog post on how the styles are rendered in modern browsers. It is titled "Font-weight is still broken in all but one browser" :)
2nd Update: As clagnut.com suffered a catastrophic dataloss here is the archived post

这篇关于所有CSS font-weight属性的值是否有用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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