💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
**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> ``` ![font-weight](https://box.kancloud.cn/05d638f609bbae150733b76d343f0f1d_134x113.png)