Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 图标字体不适用于IE9,但适用于其他版本的IE和其他浏览器_Ruby On Rails_Internet Explorer_Font Face_Font Awesome - Fatal编程技术网

Ruby on rails 图标字体不适用于IE9,但适用于其他版本的IE和其他浏览器

Ruby on rails 图标字体不适用于IE9,但适用于其他版本的IE和其他浏览器,ruby-on-rails,internet-explorer,font-face,font-awesome,Ruby On Rails,Internet Explorer,Font Face,Font Awesome,我使用font awesome为我的rails应用程序生成图标字体(不使用gem),我创建的图标字体在Chrome、FF、Safari和IE10/11中工作,但在IE9中不工作。我用下面的代码创建了一个最小的测试用例,它可以在除IE9之外的任何东西中工作(这不是rails,只是一个html文件、css文件和字体文件): CSS: HTML: 测试 这在Chrome和FF中运行良好,但在IE9中不起作用。我已经搞乱了格式、MIME类型(在实际的rails应用程序中),并且不确定下一步该怎么做。

我使用font awesome为我的rails应用程序生成图标字体(不使用gem),我创建的图标字体在Chrome、FF、Safari和IE10/11中工作,但在IE9中不工作。我用下面的代码创建了一个最小的测试用例,它可以在除IE9之外的任何东西中工作(这不是rails,只是一个html文件、css文件和字体文件):

CSS:

HTML:


测试

这在Chrome和FF中运行良好,但在IE9中不起作用。我已经搞乱了格式、MIME类型(在实际的rails应用程序中),并且不确定下一步该怎么做。想法?

我经常使用自定义字体,到目前为止我还没有遇到任何问题。下面是我将使用的

@font-face {
font-family: "my-icons";
src: url("my-icons.eot?#iefix");
src: url("my-icons.eot?#iefix") format("eot"),
   url("my-icons.woff") format("woff"),
   url("my-icons.ttf") format("truetype"),
   url("my-icons.svg") format("svg");
font-weight: normal;
font-style: normal;
}

不走运。这在IE9中对你有效,特别是?因为这是IE中唯一一个你的答案对我不适用的版本。
<html>
<head>
    <link rel="stylesheet" href="styles/font_face.css">
</head>
    <div class="test-container">
        test
        <i class="icon-test"></i>
    </div>
</html>
@font-face {
font-family: "my-icons";
src: url("my-icons.eot?#iefix");
src: url("my-icons.eot?#iefix") format("eot"),
   url("my-icons.woff") format("woff"),
   url("my-icons.ttf") format("truetype"),
   url("my-icons.svg") format("svg");
font-weight: normal;
font-style: normal;
}