1.在样式表中声明,代码如下:
@font-face {
font-family: 'icomoon';
src:url('fonts/icomoon.eot');
src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
url('fonts/icomoon.woff') format('woff'),
url('fonts/icomoon.ttf') format('truetype'),
url('fonts/icomoon.svg#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
2.在要使用的标签中引用该字体:
div {
font-family: "icomoon";
}
span::before {
font-family: "icomoon";
content: "\e900";
}