Css @ font-face在ie9中不工作 [英] Css @font-face not working in ie9

查看:103
本文介绍了Css @ font-face在ie9中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法使用自定义字体,它在每个浏览器中都应该被称为浏览器。

I managed to use a custom font which works in every browser that deserves to be called "browser". Well as always the cool things do not apply to ie (in this case ie9).

我尝试了以下操作:

@font-face { font-family: Roboto; src: url('../fonts/roboto/Roboto-Regular.ttf');}

在一些提示后,我发现在谷歌我试过:

after some hints i found on this on google i tried:

@font-face { font-family: Roboto; src: url('../fonts/roboto/Roboto-Regular.ttf');
                              src: url('../fonts/roboto/Roboto-Regular.ttf#') format('truetype');
                              font-weight: normal;
                              font-style: normal;}

因为我知道通过经验,将没有好的解决方案这个问题,但也许有人发现另一个坏的,即黑客,让我从另一个,即痛苦。

still with no success. Well as i know by experience there will be no "good" solution for this problem but maybe someone found another bad ie hack that gets me out of another ie misery.

推荐答案

您需要添加格式.eot才能被IE9识别。

You need to add the format .eot in order to be recognized by IE9.

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

来源

这篇关于Css @ font-face在ie9中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆