font-weight:
时间: 2023-06-21 09:23:13 浏览: 47
font-weight 是CSS中用于设置文本字体粗细的属性。它可以接受数字值或者关键字值。常用的关键字值包括:normal(默认值,字体正常粗细)、bold(加粗)、bolder(更加粗)、lighter(更细)、100、200、300、400、500、600、700、800、900。例如,设置字体粗细为加粗可以使用以下CSS代码:
```
font-weight: bold;
```
相关问题
font-weight: bold
The CSS property font-weight sets the weight (or thickness) of the font. The value "bold" makes the font heavier than the default weight. It can be applied to any font family and size.
Example:
```
h1 {
font-weight: bold;
}
```
This will make all h1 headings appear in bold font.
font-weight: 属性试例
好的,以下是一些CSS中font-weight属性的例子:
1. 设置字体为粗体:
```
font-weight: bold;
```
2. 设置字体为正常(默认):
```
font-weight: normal;
```
3. 设置字体更加粗(比bold更加粗):
```
font-weight: bolder;
```
4. 设置字体更加轻(比normal更加轻):
```
font-weight: lighter;
```
5. 设置字体粗细程度为500(在100-900之间以100为间隔):
```
font-weight: 500;
```