01.下载字体
看着红框里面,百度就能下载这个字体了
02.格式转化
其实是为了做到兼容,推荐使用https://www.fontke.com/tool/convfont/
03.引入到项目中
新建fonts文件夹,把上面下载好的字体放进去就好了
04.样式文件中引用字体
@font-face {
font-family: 'yentieg';
src: url('../fonts/yentieg.eot');
src: url('../fonts/yentieg.eot?#iefix') format('embedded-opentype'),
url('../fonts/yentieg.woff2') format('woff2');
font-weight: normal;
font-style: normal;
}
05.字体的使用
//这是在一个span下面使用这个字体例子,对应上面的font-family的名字
.subhead span{
font-family: yentieg;
font-size: 1.8rem;
text-align: center;
width: 10.6rem;
display: inline-block;
}