html - @font-face vitesseSans 书在 ie 中不工作

标签 html css font-face

我在我的网页中使用由 font2web.com 生成的字体 vitesseSans book。它在除 IE 之外的所有主要浏览器中都运行良好。

这里是font2web.com生成的代码

@font-face {
    font-family: 'Conv_VitesseSans-Book_0';
    src: url('fonts/VitesseSans-Book_0.eot');
    src: local('☺'), url('fonts/VitesseSans-Book_0.woff') format('woff'), url('fonts/VitesseSans-Book_0.ttf') format('truetype'), url('fonts/VitesseSans-Book_0.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

如何解决这个问题?

最佳答案

我不确定你的 @font-face 语法,以前从未见过,所以我给你一个适合我的语法:

@font-face{
 font-family:'Conv_VitesseSans-Book_0';
 src:url('fonts/Conv_VitesseSans-Book_0.eot');
 src:url('fonts/Conv_VitesseSans-Book_0.eot?#iefix') format('embedded-opentype'),
 url('fonts/Conv_VitesseSans-Book_0.woff') format('woff'),
 url('fonts/Conv_VitesseSans-Book_0.ttf') format('truetype'),
 url('fonts/Conv_VitesseSans-Book_0.svg#Conv_VitesseSans-Book_0') format('svg');
 font-weight:normal;
 font-style:normal;
}

SVG 也需要一个#ID 来在 SVG 中引用,但它缺失了。 要针对所有版本的旧 IE,首先是默认的 EOT,然后是 IE 万无一失的#iefix & 格式(嵌入式开放类型)。

也许这对您不起作用,也许您的 EOT 因在线转换而损坏?这是可能的,有时会发生。

关于html - @font-face vitesseSans 书在 ie 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18932027/

相关文章:

javascript - CSS 动画比 JS 动画快吗?

javascript - jScrollPane 上的边距/边框隐藏箭头

svg - 是否可以从命令行从 SVG 创建字体 (TTF)?

css 3字体创建换行符

css - 不同浏览器的字体大小差异很大

html - & or & or and 在代码中的意思是一样的吗?

javascript - 我如何修复 :hover on iPhone if there is no <a> element?

javascript - 如何在 Bootstrap 中在我的网页上实现平滑滚动?

css - 响应式 css 不适用于智能手机,但适用于调整浏览器大小

css - 在网站中使用哪个字体文件?