# 测试font-weight属性效果

2018年4月5日 / 4次阅读
CSS

CSS中font-weight后面可以接lighter，normal，bold，bolder，还是接100-900数值，默认是normal，400。700对应bold。

<html>
<title>test</title>
<body>
<p style="font-weight:100">font-weight:100</p>
<p style="font-weight:lighter">font-weight:lighter</p>
<p style="font-weight:normal">font-weight:normal</p>
<p style="font-weight:bold">font-weight:bold</p>
<p style="font-weight:bolder">font-weight:bolder</p>
<p style="font-weight:900">font-weight:900</p>
</body>
</html>

HTML官方的一段文字：

You should always bear in mind that the content of a b element may not always be bold, and that of an i element may not always be italic. The actual style is dependent on the CSS style definitions. You should also bear in mind that bold and italic may not be the preferred style for content in certain languages.

You should not use b and i tags if there is a more descriptive and relevant tag available. If you do use them, it is usually better to add class attributes that describe the intended meaning of the markup, so that you can distinguish one use from another.

<strong>，加重语气；

<em>，着重文字；

<b>，粗体文字；

<i>，斜体文字。