简体   繁体   English

我无法使用@font face for Internet Explorer 11

[英]I Cant get @font face to work for internet explorer 11

I have been trying to use a custom font it seems to work on everything but not internet explorer 11. Am I missing something really easy here to make this work? 我一直在尝试使用一种自定义字体,它似乎可以在所有程序上运行,但不能在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 */


}

If you are new to coding, maybe the easiest solution is to embed the font by putting it in the beginning of your <head> tag like this: 如果您不熟悉编码,也许最简单的解决方案是通过将字体放在<head>标记的开头来嵌入字体,如下所示:

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

There are several similar questions asked and answered that can help you troubleshoot: 提出并回答了一些类似的问题,可以帮助您进行故障排除:

It is wise to do a search before you post a question. 在发布问题之前进行搜索是明智的。

If you'd like to test your site in Explorer on a Mac, there is even questions and answers for that. 如果您想在Mac上的资源管理器中测试您的网站,甚至还有疑问和解答。 This one should work well if you have several GBs to spare. 如果您有几个GB可用,则该选项应该可以正常工作 If not you can look into the new Azure RemoteApp for Windows, Mac OSX, iOS or Android devices. 如果没有,您可以查看适用于Windows,Mac OSX,iOS或Android设备的新Azure RemoteApp。

This works fine for IE 11 对于IE 11来说效果很好

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM