css设置文字思源雅黑,分为medium, regular, light

html引入思源黑体

通过Link标签在网页头部引用Google Web Font:

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Sans+SC:100,300,400,500,700,900">
  • 字体:Noto Sans SC
  • 大小:100, 300, 400, 500, 700, 900

在需要使用思源黑体的地方设置CSS样式:

font-family: "Noto Sans SC";
font-weight: 100;

TIP:Link标签的rel属性的全称是relationship,表示引用内容与当前HTML的关系。

Regular、Normal、Medium、Light 对应的font-weight值

字体粗细:‘font-weight’属性
名称: font-weight
取值: normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
初始: normal
100 - Thin
200 - Extra Light (Ultra Light)
300 - Light
400 - Regular (Normal、Book、Roman)
500 - Medium
600 - Semi Bold (Demi Bold)
700 - Bold
800 - Extra Bold (Ultra Bold)
900 - Black (Heavy)

normal、regular与'400'相同。
bold与'700'相同。
bolder指定外观的重量大于继承的值。
lighter 指定外观的重量小于继承的值。
详见W3C Fonts节章的规范标准

原文地址:https://www.cnblogs.com/chenyingying0/p/13299185.html