css - 字体不会在任何版本的 Internet Explorer 上加载

标签 css font-face

我想在我的网站上为我的 Logo 添加两种字体,Bebas Neue Regular 和 Bebas Neue Thin。

我使用 font-squirrels 在线字体转换工具转换了我的字体,并将相关的@font-face 代码添加到我的 css 中:

@font-face { 
     font-family: BebasNeueReg; 
     src: url("/fonts/BebasNeueRegular.eot"); 
     src: url("/fonts/BebasNeueRegular.eot?#iefix") format('embedded-opentype'), 
     url("/fonts/BebasNeueRegular.woff2") format('woff2'), 
     url("/fonts/BebasNeueRegular.woff") format('woff'), 
     url("/fonts/BebasNeueRegular.ttf") format('truetype'), 
     url("/fonts/BebasNeueRegular.svg") format('svg'); 
}

如您所见,这是 Bebas Neue Regular 的 @font-face css。由于某些奇怪的原因,Bebas Neue Thin 的 css @font-face 在所有浏览器中都可以正常工作。除了 src 不同之外,此 css 完全相同。

@font-face { 
   font-family: BebasNeueThin; 
   src: url("/fonts/BebasNeueThin.eot"); 
   src: url("/fonts/BebasNeueThin.eot?#iefix") format('embedded-opentype'), 
   url("/fonts/BebasNeueThin.woff2") format('woff2'), 
   url("/fonts/BebasNeueThin.woff") format('woff'), 
   url("/fonts/BebasNeueThin.ttf") format('truetype'), 
   url("/fonts/BebasNeueThin.svg") format('svg'); 
}

我尝试了多种方法,例如使用不同的字体转换工具转换字体,交换 url 的顺序。

任何人都可以阐明一下吗?以前有人遇到过完全相同的问题吗?

提前致谢。

最佳答案

我清除了所有内容并重新开始。下载我想成为元素一部分的字体,然后使用网络字体生成器将它们转换为网络字体。然后我将它们添加回元素并使用了压缩文件中的 CSS @font-face。这似乎有固定的东西。可能是我一开始尝试转换的损坏的开放式字体。

关于css - 字体不会在任何版本的 Internet Explorer 上加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29577861/

相关文章:

css - 越过窗口高度会增加元素宽度?

iphone - CSS:如果媒体类型是短语,如何将 <link media =""/> 设置为带有 @media 的内联 CSS?

css - @font-face Safari 字体 mime 类型警告

css - font-face 在 IE 中运行但在 firefox 中不运行 - 字体格式

css - LESS CSS 所有文本不再显示

javascript - 无论字体系列如何,Firefox 中的字体总是比 Chrome 更粗

css - 包含哈希时,Chrome 不会为字体呈现 svg

javascript - Helvetica 在 Windows 操作系统上呈现为 Arial

css 在所有浏览器上图像周围的相等边框

2 个不同的 android 版本中的 CSS 问题。(4.1.2 和 4.4.2)