**font-weight**
* 描述:設置對象中的文本字體的粗細。
* 版本:CSS1
* 繼承性:有
**語法**
```
font-weight:取值;
```
取值
normal:正常字體,相當于數字值400。
bold:粗體,相當于數字值700。
bolder:設置比繼承值更重的值。
lighter:設置比繼承值更輕的值。
數值:用數值設置文本字體粗細。取值:100,200,300,400,500,600,700,800,900
**使用說明**
效果由客戶端系統安裝的字體的特定字體變量映射決定。系統會選擇最近的匹配。即:可能看不出不同值之間的差異。
**代碼示例**
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>font-weight</title>
<style>
#container .p1{
font-weight: bold;
}
#container .p2{
font-weight: lighter ;
}
#container .p3{
font-weight: 800;
}
</style>
</head>
<body>
<div id="container">
<p class="p1">測試字體</p>
<p class="p2">測試字體</p>
<p class="p3">測試字體</p>
</div>
</body>
</html>
```

- 空白目錄
- CSS3專業名詞
- 復合屬性
- 繼承性
- CSS3背景
- background
- background-color
- background-image
- background-repeat
- background-attachment
- background-position
- background-origin
- background-clip
- background-size
- CSS邊框
- border
- border-width
- border-style
- border-color
- border-top
- border-top-width
- border-top-style
- border-top-color
- border-right
- border-right-width
- border-right-style
- border-right-color
- border-bottom
- border-bottom-width
- border-bottom-style
- border-bottom-color
- border-left
- border-left-width
- border-left-style
- border-left-color
- border-radius
- border-top-left-radius
- border-top-right-radius
- border-bottom-right-radius
- border-bottom-left-radius
- CSS顏色
- color
- opacity
- CSS字體
- font
- font-style
- font-variant
- font-weight
- font-size
- font-family
- font-stretch
- font-size-adjust
- CSS定位
- position
- z-index
- clip