【发布时间】:2011-07-07 10:52:37
【问题描述】:
我目前正在尝试在我构建的网站上实现 webfonts,我想将它用作 font-family 属性中的后备,即如果字符未在 Arial / Helvetica 中表示,那么它应该在 webfont 中用过。
我知道这在 IE6 和 7 中不起作用,但希望它在 IE8 中起作用,但似乎也不行。
我只是想知道是否有人遇到过这个问题,以及是否可以在 IE8 中使用 webfont 作为备用字体,或者是否有人可以看到我只是在代码中做错了什么。
提前感谢您的帮助
这是我的css代码:
@font-face {
font-family: 'stix';
src: url('/webfonts/webfont.eot');
src: local('☺'), url('/webfonts/webfont.woff') format('woff'), url('/webfonts/webfont.ttf') format('truetype'), url('/webfonts/webfont.svg#webfont3hGwcDt1') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'stix';
src: url('/webfonts/bold-webfont.eot');
src: local('☺'), url('/webfonts/bold-webfont.woff') format('woff'), url('/webfonts/bold-webfont.ttf') format('truetype'), url('/webfonts/bold-webfont.svg#webfontJse4ZhT8') format('svg');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'stix';
src: url('/webfonts/talic-webfont.eot');
src: local('☺'), url('/webfonts/italic-webfont.woff') format('woff'), url('/webfonts/italic-webfont.ttf') format('truetype'), url('/webfonts/italic-webfont.svg#webfonthDLBqRGk') format('svg');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'stix';
src: url('/webfonts/bold_italic-webfont.eot');
src: local('☺'), url('/webfonts/bold_italic-webfont.woff') format('woff'), url('/webfonts/bold_italic-webfont.ttf') format('truetype'), url('/webfonts/bold_italic-webfont.svg#webfontnuMlJc7x') format('svg');
font-weight: bold;
font-style: italic;
}
body { font-family: arial, helvetica, clean, stix, sans-serif}
body.ie6 #content, body.ie6 .popup { font: 15px/1.6em stix; }
【问题讨论】:
-
错字,可能会有所不同:/webfonts/talic-webfont.eot -> /webfonts/italic-webfont.eot
标签: css internet-explorer fonts font-face font-family