我之前是这么用的,如下
@font-face {
font-family: "yhg";
src: url(../fonts/yhg.eot);
src: url(../fonts/yhg.woff) format('woff'),
url(../fonts/yhg.ttf) format('truetype'),
url(../fonts/yhg.eot?#iefix) format('embedded-opentype'),
url(../fonts/yhg.svg#yhg) format('svg');
font-weight: normal;
font-style: normal;
}
.s23:before,.s24:before{
font-family: 'yhg';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
position: relative;
-webkit-font-smoothing: antialiased;
}
.s23:before{
content: "e600";
}
.s24:before{
content: "e601";
}
发现ie8显示不出来字体,折腾了半天,是@font-face的顺序写错了。
正确的应该是这样:
@font-face {
font-family: "yhg";
src: url(../fonts/yhg.eot);
src: url(../fonts/yhg.eot?#iefix) format('embedded-opentype'),
url(../fonts/yhg.woff) format('woff'),
url(../fonts/yhg.ttf) format('truetype'),
url(../fonts/yhg.svg#yhg) format('svg');
font-weight: normal;
font-style: normal;
}