I am trying to figure out how to get grayscale to work in IE 10 and 11. I have a grid of icons that I want to grayscale. It's built something like this:

我试图找出如何让灰度在I​​E 10和11中工作。我有一个图标网格,我想要灰度。它的构建如下:

<ul class="medium-block-grid-4 large-block-grid-4">

    <li>
        <a href="#"><figure class="cap-bot report-10x10">
            <figcaption>Caption. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean egestas lectus non odio bibendum iaculis. Proin a lorem purus.</figcaption>
        </figure></a>
    </li>

    <li>
        <a href="#"><figure class="cap-bot report-10kbonus locked">
            <figcaption><i class="fa fa-lock fa-5x fa-fw" style="margin-bottom: 1rem;"></i><br> Caption. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean egestas lectus non odio bibendum iaculis. Proin a lorem purus.</figcaption>
        </figure></a>
    </li>

<ul>

The first figure is full color. The second figure contains the classes "locked grayscale" which makes the whole figure gray. It's working fine in Chrome, Safari, and Firefox. But it doesn't work in IE.

第一个数字是全彩色。第二个图包含“锁定灰度”类,使整个图形变灰。它在Chrome,Safari和Firefox中运行良好。但它在IE中不起作用。

I've looked at various solutions and tried to implement some jQuery plugins (such as this one and this one), but it seems like of them are written specifically to grayscale images. Is there a way to grayscale items in IE that aren't images? My icons are contained in square blue divs with blue borders, and I'd like to force everything to be gray.

我已经查看了各种解决方案,并试图实现一些jQuery插件(例如这一个和这个),但似乎它们是专门为灰度图像编写的。有没有办法在IE中灰度图像不是图像?我的图标包含在带蓝色边框的方形蓝色div中,我想强制一切都是灰色的。

UPDATE: Here is a fiddle with the icons in question.

更新:这是一个有问题的图标的小提琴。

1 个解决方案

#1


0

Try this css

试试这个css

a i.fa{color:#ccc;}
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
<ul>    
<li>
    <a href="#"><figure class="fig-1 cap-bot">
        <figcaption><i class="fa fa-lock fa-5x fa-fw" style="margin-bottom: 1rem;"></i><br>Caption goes here.</figcaption>
    </figure></a>
</li>
<li>
    <a href="#"><figure class="fig-2 cap-bot locked grayscale">
        <figcaption><i class="fa fa-lock fa-5x fa-fw" style="margin-bottom: 1rem;"></i><br>Caption goes here.</figcaption>
    </figure></a>
</li>
</ul>

更多相关文章

  1. 如何更改Gmaps.js在Google地图中使用的图标?
  2. 【HTML&CSS】【7】网址栏左侧出现的图标Icon
  3. “/图标。ico " vs
  4. 图标旋转但返回上一个位置
  5. jQuery更改活动类图标的状态
  6. 将一个youtube iframe放在另一个具有关闭图标的框架上
  7. 在导航图标css下包装文本。
  8. android Editview中加小图标或者文字实现
  9. android 百度地图路线规划去掉节点图标

随机推荐

  1. XML学习(二)详解DOM操作XML文档
  2. XML实战秘籍第三卷:动态分页
  3. XML学习(一)元素,属性,读取详解
  4. XML实战秘籍第二卷:动态查询
  5. 详细介绍XML和HTML常用转义字符
  6. XML实战秘籍第一卷:动态排序
  7. 详细介绍xml的使用方法总结
  8. XML基础讲解之结构与语法
  9. 详细介绍Android 解析XML文件和生成XML文
  10. XML文件数减少的示例代码分享