css 字体文件中写入:
@font-face {
font-family: 'keji';
src: url('heijian.eot') format('embedded-opentype'), url('heijian.woff2') format('woff2'), url('heijian.woff') format('woff'), url('heijian.ttf') format('truetype'), url('heijian.svg') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face 引入字体;
font-family:自定义名称
src: url 字体路径
.TTF或.OTF,适用于Firefox 3.5、Safari、Opera
.EOT,适用于Internet Explorer 4.0+
.SVG,适用于Chrome、IPhone
网络上有字体转换器。
css样式中,用 font-family:keji;调用即可。
特别注意引入文件的路径要正确。