下载字体
http://xiazaiziti.com/
新建font.css
引入字体包到项目中 eg: pingfangSC.tff
1 2 3 4 5 6
| @font-face { font-family: "PingFangSC"; src: url("pingfangSC.tff"); font-weight: normal; font-style: normal; }
|
需要的地方引入
1 2 3 4 5
| <line rel="stylesheet" href="font.css">
.class { font-family: PingFangSC }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| 苹方提供了六个字重,font-family 定义如下: 苹方-简 常规体 font-family: PingFangSC-Regular, sans-serif; 苹方-简 极细体 font-family: PingFangSC-Ultralight, sans-serif; 苹方-简 细体 font-family: PingFangSC-Light, sans-serif; 苹方-简 纤细体 font-family: PingFangSC-Thin, sans-serif; 苹方-简 中黑体 font-family: PingFangSC-Medium, sans-serif; 苹方-简 中粗体 font-family: PingFangSC-Semibold, sans-serif;
苹方除了简体的:苹方-简(PingFang SC),还为繁体用户提供有:苹方-繁(PingFang TC) ,苹方-港(PingFang HK)
苹方-繁 的 CSS font-family 使用: font-family: PingFangTC-Regular, sans-serif; font-family: PingFangTC-Ultralight, sans-serif; font-family: PingFangTC-Light, sans-serif; font-family: PingFangTC-Thin, sans-serif; font-family: PingFangTC-Medium, sans-serif; font-family: PingFangTC-Semibold, sans-serif;
苹方-港 的 CSS font-family 使用: font-family: PingFangHK-Regular, sans-serif; font-family: PingFangHK-Ultralight, sans-serif; font-family: PingFangHK-Light, sans-serif; font-family: PingFangHK-Thin, sans-serif; font-family: PingFangHK-Medium, sans-serif; font-family: PingFangHK-Semibold, sans-serif;
|