css教程网 css教程网365css.cn
公告为您打开互联网世界的窗户关于本站

font-weight

字重,100–900。中文只有少数几档真正可用。

语法
font-weight: <number> | normal | bold | lighter | bolder
常用值
100–900(100 的整数倍)/ normal / bold
初始值
normal(400)
继承
是

运行效果

示例改成别的值试试,差异一眼能看出来
查看代码
HTML
<div class="fw"><i style="font-weight:400">400 常规</i><i style="font-weight:600">600 半粗</i><i style="font-weight:800">800 特粗</i></div>
CSS
.fw i { display: block; font-size: 14px; color: #0d1117; font-style: normal; line-height: 1.9; }

使用要点

  • 系统中文黑体通常只有 400 与 700,中间档会被就近映射,看不出差别。
  • 标题不要只靠字号拉开层级,字重与颜色一起用更有效。