引用fontello的iconfont,复制字符到html文件中。
目录结构如下:
其中magic.css内容如下:
@font-face {
font-family: 'fontello';
src: url('../asserts/font/fontello.eot?98310639');
src: url('../asserts/font/fontello.eot?98310639#iefix') format('embedded-opentype'), url('../asserts/font/fontello.woff?98310639') format('woff'), url('../asserts/font/fontello.ttf?98310639') format('truetype'), url('../asserts/font/fontello.svg?98310639#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
内嵌,除了字体路径做了相应更改外原封不动:
Document/* 内嵌定义的字体无效 */
@font-face {
font-family: 'fontello';
src: url('./asserts/font/fontello.eot?98310639');
src: url('./asserts/font/fontello.eot?98310639#iefix') format('embedded-opentype'), url('../asserts/font/fontello.woff?98310639') format('woff'), url('../asserts/font/fontello.ttf?98310639') format('truetype'), url('../asserts/font/fontello.svg?98310639#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
span {
font: 16px/30px fontello;
}
效果如图,乱码:
接着外链:
Document/* 内嵌定义的字体无效 */
/* @font-face {
font-family: 'fontello';
src: url('./asserts/font/fontello.eot?98310639');
src: url('./asserts/font/fontello.eot?98310639#iefix') format('embedded-opentype'), url('../asserts/font/fontello.woff?98310639') format('woff'), url('../asserts/font/fontello.ttf?98310639') format('truetype'), url('../asserts/font/fontello.svg?98310639#fontello') format('svg');
font-weight: normal;
font-style: normal;
} */
span {
font: 16px/30px fontello;
}
效果如下:
请问为什么效果会不同呢?感觉应该是等效的引用。
系统:win10 专业版 版本1067
浏览器: