freeCodeCamp/guide/chinese/typography/font-weight-and-style/index.md

30 lines
932 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: Font Weight and Style
localeTitle: 字体重量和样式
---
## 字体重量和样式
字体粗细可以写为文本值:
```
font-weight: normal;
font-weight: bold;
```
或者作为`100`到`900`的数值以100的倍数表示
```
font-weight: 400; /* equal to 'normal' above */
font-weight: 700; /* equal to 'bold' above */
```
数值及其共同描述
|价值|共同描述| | ----- | ---------------------------- | | 100 |薄(发际线)| | 200 |超轻(超轻)| | 300 |光| | 400 |正常| | 500 |中| | 600 |半大胆Demi Bold| | 700 |大胆| | 800 |额外大胆(超大胆)| | 900 |黑色(重)|
并非所有字体都可以使用所有权重。某些专用字体可能仅在一个重量(通常为`normal` `400` )中可用。
也可以相对于元素的父元素指定字体粗细(如果字体具有多个权重):
```
font-weight: lighter;
font-weight: bolder;
```