如何设置字体的粗细

实例解析:

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>
提交重置代码
章节
笔记
提问
课件
反馈
捐赠

CSS 代码实例

  • 推荐课程
  • 评论
  • 问答
  • 笔记
  • 课件下载
课件暂不提供下载,工作人员正在整理中,后期请多关注该课程~