如何设置字体的粗细
实例解析:
font-weight属性用于设置文本的粗细。
可以设置以下属性值:
| 值 | 描述 |
|---|---|
| normal | 默认值,定义标准的字符。 |
| bold | 定义粗体字符。 |
| bolder | 定义更粗的字符。 |
| lighter | 定义更细的字符。 |
○ 100 ○ 200 ○ 300 ○ 400 ○ 500 ○ 600 ○ 700 ○ 800 ○ 900 | 定义由粗到细的字符。400 等同于 normal,而 700 等同于 bold。 |
新建文件
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文网(php.cn)</title>
<style>
p.normal {font-weight:normal;}
p.light {font-weight:lighter;}
p.thick {font-weight:bold;}
p.thicker {font-weight:900;}
</style>
</head>
<body>
<p class="normal">This is a paragraph.</p>
<p class="light">This is a paragraph.</p>
<p class="thick">This is a paragraph.</p>
<p class="thicker">This is a paragraph.</p>
</body>
</html>
预览
Clear
- 课程推荐
- 课件下载
课件暂不提供下载,工作人员正在整理中,后期请多关注该课程~ 















