Internet explorer IE8@font-face在定义非仅eot时不起作用
在这种情况下,一切正常,字体显示正确:Internet explorer IE8@font-face在定义非仅eot时不起作用,internet-explorer,css,internet-explorer-8,font-face,Internet Explorer,Css,Internet Explorer 8,Font Face,在这种情况下,一切正常,字体显示正确: @font-face { font-family: 'CalibriRegular'; src: url('fonts/calibri.eot'); } 但当我添加其他格式时,IE8中不会显示字体: @font-face { font-family: 'CalibriRegular'; src: url('fonts/calibri.eot'); src: url('fonts/calibri.eot') form
@font-face {
font-family: 'CalibriRegular';
src: url('fonts/calibri.eot');
}
但当我添加其他格式时,IE8中不会显示字体:
@font-face {
font-family: 'CalibriRegular';
src: url('fonts/calibri.eot');
src: url('fonts/calibri.eot') format('embedded-opentype'),
url('fonts/calibri.woff') format('woff'),
url('fonts/calibri.ttf') format('truetype'),
url('fonts/calibri.svg#CalibriRegular') format('svg');
}
有什么问题吗?感谢当我过去使用
@font-face
时,我使用了以下内容:
@font-face {
font-family: 'webfontregular';
src: url('../fonts/font.eot');
src: url('../fonts/font.eot?#iefix') format('embedded-opentype'),
url('../fonts/font.woff') format('woff'),
url('../fonts/font.ttf') format('truetype'),
url('../fonts/font.svg#webfontregular') format('svg');
font-weight: normal;
font-style: normal;
}
我能看到的唯一区别是第二个
.eot
声明末尾附加了#iefix
。这个能帮你修好吗?我在使用IE7+时从来没有遇到过问题。您需要一个散列,通常是?#iefix
用于约定,在出现在多个src列表中的eot上。
这就解释了为什么:
@font-face {
font-family: 'CalibriRegular';
src: url('fonts/calibri.eot');
src: url('fonts/calibri.eot?#iefix') format('embedded-opentype'),
url('fonts/calibri.woff') format('woff'),
url('fonts/calibri.ttf') format('truetype'),
url('fonts/calibri.svg#CalibriRegular') format('svg');
}