@font-face{ font-family: '字体名称随便起'; src: url('../font/字体名称.eot'); src:url('../font/字体名称.woff') format('woff'), url('../font/字体名称.ttf') format('truetype'), url('../font/字体名称.svg') format('svg'); } //html中的代码中加一个h1或者其他的,里面写你自己想要的特殊文字 h1{font-size:36px; color:#ccc;font-family: "字体名称随便起";}
我的实现
@font-face{ font-family: kkk; src: url('../fonts/china2.ttf') } p { font-family: kkk; }
压缩字蛛官网:http://font-spider.org/
//1 安装字体压缩 npm install font-spider //2.进行压缩 font-spider ./demo/*.html