【问题标题】:I Cant get @font face to work for internet explorer 11我无法让@font face 为 Internet Explorer 11 工作
【发布时间】:2015-02-01 17:09:24
【问题描述】:

我一直在尝试使用自定义字体,它似乎适用于所有东西,但不适用于 internet explorer 11。我是否错过了一些非常容易做到这一点的东西?

@font-face {
font-family: 'comfortaa';
src: url('Comfortaa.eot'); /* IE9 Compat Modes */
src: url('Comfortaa.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
     url('../fonts/Comfortaa_Regular.ttf.woff') format('woff'), /* Modern Browsers */
     url('../fonts/Comfortaa_Regular.ttf')  format('truetype'), /* Safari, Android, 
   iOS    */
     url('../fonts/Comfortaa_Regular.svg') format('svg'); /* Legacy iOS */


}

@font-face {
font-family: 'comfortaabold';
src: url('Comfortaa-Bold.eot'); /* IE9 Compat Modes */
src: url('Comfortaa-Bold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
     url('../fonts/Comfortaa-Bold.ttf.woff') format('woff'), /* Modern Browsers */
     url('../fonts/Comfortaa-Bold.ttf')  format('truetype'), /* Safari, Android, iOS */
     url('../fonts/Comfortaa-Bold.svg') format('svg'); /* Legacy iOS */


}

【问题讨论】:

  • 我在某处读过我可能需要将字体移动到网站顶层的其他地方?

标签: internet-explorer fonts


【解决方案1】:

如果您是编码新手,也许最简单的解决方案是通过将字体放在 <head> 标记的开头来嵌入字体,如下所示:

<link href='http://fonts.googleapis.com/css?family=Comfortaa:700' rel='stylesheet' type='text/css'>

有几个类似的问题可以帮助您进行故障排除:

在发布问题之前进行搜索是明智的。

如果您想在 Mac 上的 Explorer 中测试您的网站,甚至还有相关的问题和答案。 This one should work well 如果您有几个 GB 可用。如果没有,您可以查看适用于 Windows、Mac OSX、iOS 或 Android 设备的新 Azure RemoteApp。

【讨论】:

    【解决方案2】:

    这适用于 IE 11

        @font-face
        {
            font-family: "MyFont_Lite";
            src: url("../Fonts/myfont.ttf") format("truetype");
            src: url("../Fonts/myfont.woff") format("woff");
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-22
      • 2015-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多