css - IE8字体问题

标签 css internet-explorer-8 font-face

我在 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/

相关文章:

javascript - Mouseup取消所有Mousedown下的事件

css - 带有字体的自定义脚本字体字距调整和字母间距

css - 网络字体和使用本地字体

html - ie 8 自定义谷歌字体的问题

html - 移动设备上的引导导航栏行为

html - 显示输入类型 ="radio"内联样式 - 使用 icheck-me 类 [icheck 插件]

css - 如何导入字体粗细为 500 的字体

javascript - 当输入框将焦点放在登录字段上时,正在创建空间

css - 水平滚动条在 ie7 和 ie8 中非常大

html - 调整大小超过最大宽度的表格单元格