IE中的多个CSS过滤器 [英] Multiple CSS filters in IE

查看:143
本文介绍了IE中的多个CSS过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道,可以应用两个不同的过滤器在IE使用CSS。
所以,我需要使用透明的PNG和一些不透明的 div 。是否可以同时使用这两个?



我的透明制作者行如下所示:

  li.item .item-texture {
background:none transparent scroll repeat 0%0%!important;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src ='/ images / ie / articles / item-content-hov.png',sizingMethod ='scale')!important;
}



我尝试添加一行(重要的是,alpha(opacity = 50); );和单独的过滤器用逗号(.. 'scale'

$ p

解决方案

不能有多个过滤器属性,因为IE只会占用最后一个

注意:由于这似乎得到几个投票,我想澄清一下,这并不意味着你可以不能应用多个过滤器,只是您只能使用1 过滤器 属性。如果您尝试应用多个过滤器并将它们分离为多个属性,则只有最后一个过滤器将生效。



根据MSDN的以下文章,逗号但空格: http:// msdn。 microsoft.com/en-us/library/ms532847(v=vs.85).aspx



另请注意,某些IE过滤器(包括alpha)需要要正确应用元素的布局: http://www.satzansatz.de/cssd /onhavinglayout.html


I'm just wondering that it is possible to apply two different filters in IE using CSS. So, I need to use a transparent PNG and also some opacity to a div. Is it possible to use both of them?

My transparent-maker line looks like this:

li.item .item-texture {
   background: none transparent scroll repeat 0% 0% !important; 
   filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/ie/articles/item-content-hov.png', sizingMethod='scale') !important;
}

I've tried to add one more line ( filter: alpha(opacity=50); ) and separate filters with comma ( ..'scale') !important, alpha(opacity=50); ), but it was useless.

解决方案

There cannot be more than 1 filter property, as IE will only take the last one into effect.

NOTE: Since this seems to be getting a few down votes I wanted to clarify that this doesn't mean you can't apply multiple filters, just that you can only use 1 filter property. If you try applying multiple filters and separate them out into multiple properties, only the last one will take effect.

According to the following article from MSDN, they are separated not by a comma but a space: http://msdn.microsoft.com/en-us/library/ms532847(v=vs.85).aspx

Also note that some IE filters (alpha included) require the element to have layout in order to be applied correctly: http://www.satzansatz.de/cssd/onhavinglayout.html

这篇关于IE中的多个CSS过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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