我在 IE8 的网络开发过程中遇到了问题。该网站应支持IE8。字体将无法正确显示。
我使用以下代码:
@font-face {
font-family: 'MyFont';
src: url('./fonts/myfont/eot/Myfont.eot');
src: url('./fonts/myfont/eot/Myfont.eot?iefix') format('eot'),
url('./fonts/myfont/woff/Myfont.woff') format('woff'),
url('fonts/myfont/ttf/Myfont.ttf') format('truetype'),
url('./fonts/myfont/svg/Myfont.svg#webfont') format('svg');
font-weight: normal;
font-style: normal;
}
我该怎么做才能正确显示字体?
感谢您的帮助。
最佳答案
看起来你没有正确格式化它
如果你的链接在树之外,你应该有 ../
而不是 ./
.
此外,您还遗漏了 truetype
的尾随。
而eot
应该是embedded-opentype
@font-face {
font-family: 'MyFont';
src: url('../fonts/myfont/eot/Myfont.eot');
src: url('../fonts/myfont/eot/Myfont.eot?iefix') format('embedded-opentype'),
url('../fonts/myfont/woff/Myfont.woff') format('woff'),
url('../fonts/myfont/ttf/Myfont.ttf') format('truetype'),
url('../fonts/myfont/svg/Myfont.svg#webfont') format('svg');
font-weight: normal;
font-style: normal;
}
关于css - IE8字体问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31533617/