the application i am developing is throwing 404 errors when the browser is IE7 or IE8. But they work in other more recent versions or in other browsers.
错误是这样的:
/PresentationLayer/fonts/MyFontLt.ttf)%20format(%22truetype%22),%20url(fonts/MyFontRg.svg
在我的 CSS 文件中有这样的东西(适用于所有浏览器,IE7 和 IE8 除外):
@font-face{
font-family:'MyBold';
src:url("fonts/MyFontrgbd-webfont.eot");
src:url("fonts/MyFontrgbd-webfontd41d.eot?#iefix") format("embedded-opentype"),
url("fonts/MyFontrgbd-webfont.woff") format("woff"),
url("fonts/MyFontrgbd-webfont.ttf") format("truetype"),
url("fonts/MyFontrgbd-webfont.svg#MyFontBold") format("svg");
font-weight:400;font-style:normal}
@font-face{font-family:'MyFontRegular';
src:url("fonts/MyFontRgd41d.eot");
src:url("fonts/MyFontRgd41dd41d.eot?#iefix") format("embedded-opentype"),
url("fonts/MyFontRg.woff") format("woff"),
url("fonts/MyFontRg.ttf") format("truetype"),
url("fonts/MyFontRg.svg#MyFontRegular") format("svg");
font-weight:400;font-style:normal}
@font-face{font-family:'MyFontLight';
src:url("fonts/MyFontRg.ttf") format("truetype");
font-weight:400;font-style:normal}
@font-face{
font-family:'MyFontLight';
src:url("fonts/MyFontLt.ttf") format("truetype"),
url("fonts/MyFontRg.svg#MyFontRegular") format("svg");
font-weight:400;font-style:normal}
有人可以帮忙解决这个问题吗?
注意:
- 我已经尝试过 Mime-Types
- 嵌入的字体权限 可安装
- ...
...
最佳答案
您的代码的问题是最后一个 @font-face
规则的 src 属性不包含受支持的值。因此,它将值视为一个大 url,显然,它指向任何地方。
要解决此问题,只需添加 url(path/to/example.eot?#iefix) format('embedded-opentype'),
作为堆栈的第一个值。
关于css - IE7 和 IE8 在 TTF 中抛出 404 错误 - 字体? CSS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28890038/