简体   繁体   English

CSS图像过滤器-浏览器兼容性

[英]css image filters - browser compatibility

I'm looking for a smooth solution to implement a filter (blur + opacity) to images - working on the most popular browsers (sadly, IE counts as well!), and my code isn't working properly: 我正在寻找一种平滑的解决方案,以对图像实施过滤器(模糊+不透明)-在最受欢迎的浏览器上运行(可悲的是,IE也很重要!),我的代码无法正常运行:

-webkit-filter: blur(3px) opacity(40%);
-moz-filter: blur(3px) opacity(40%);
-o-filter: blur(3px) opacity(40%);
-ms-filter: blur(3px) opacity(40%);
filter: blur(3px) opacity(40%);

http://caniuse.com/#feat=css-filters http://caniuse.com/#feat=css-filters

I need an alternative to svg markup, too much to adjust: 我需要svg标记的替代方法,无法调整:

<svg>
  <image ... />
  <filter id="test">
    <feGaussianBlur stdDeviation="3"/>
    <feComponentTransfer>
      <feFuncA type="table" tableValues="0 0.8"/>
    </feComponentTransfer>
  </filter>
</svg>

.tile:hover image{ filter:url(#test); }

There has to be an easier solution than this, adjusting my markup to work with svg is too much work. 必须有一个比这更简单的解决方案,调整我的标记以与svg一起工作是太多的工作。

a demo of the gallery I'm building can be viewed here 我正在建造的画廊的演示可以在这里查看

Thanks in advance for your help or hints! 在此先感谢您的帮助或提示!

The CSS filter is 175 characters. CSS过滤器为175个字符。 The SVG markup is 195 characters. SVG标记是195个字符。 If you want IE support, you have to use SVG. 如果需要IE支持,则必须使用SVG。 It's not that bad. 没那么糟糕。

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

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