CSS -ms-filter 与 filter 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6900647/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
-ms-filter vs filter What's the difference?
提问by Web_Designer
What's the difference between between IE's filter
and -ms-filter
properties? If I use one should I use them both? Do they do the same thing, but each work on only certain versions of IE?
IEfilter
和-ms-filter
属性之间有什么区别?如果我使用一个,我应该同时使用它们吗?他们做同样的事情,但每个人都只在某些版本的 IE 上工作吗?
回答by duri
Microsoft introduced -ms-filter
to make Internet Explorer more standards-compliant (CSS 2.1 requires vendor extensions to have vendor prefix). As the syntax of original filter
property is not CSS 2.1 compliant, IE8+ requires the value of the -ms-filter
property to be enclosed in quotation marks.
Microsoft 引入-ms-filter
以使 Internet Explorer 更符合标准(CSS 2.1 要求供应商扩展具有供应商前缀)。由于原始filter
属性的语法不符合 CSS 2.1,IE8+ 要求将-ms-filter
属性值括在引号中。
filter: alpha(opacity=40);
-ms-filter: "alpha(opacity=40)";
-ms-filter
is supported in IE8+, legacy filter
property is, as far as I know, for backwards compatibility supported in all versions of Internet Explorer.
-ms-filter
IE8+ 支持filter
,据我所知,遗留属性是为了在所有版本的 Internet Explorer 中支持向后兼容性。
Related link: http://blogs.msdn.com/b/ie/archive/2008/09/08/microsoft-css-vendor-extensions.aspx
相关链接:http: //blogs.msdn.com/b/ie/archive/2008/09/08/microsoft-css-vendor-extensions.aspx
Please note that support for filters may be removed in IE10.
请注意,IE10 中可能会删除对过滤器的支持。
回答by sonus21
-ms-filter property
Sets or retrieves the filter or collection of filters that are applied to the object. Note As of Windows Internet Explorer 9 this feature was deprecated. As of Internet Explorer 10 this feature was removed and should no longer be used.
-ms-filter 属性
设置或检索应用于对象的过滤器或过滤器集合。注意 从 Windows Internet Explorer 9 开始,此功能已被弃用。从 Internet Explorer 10 开始,此功能已被删除,不应再使用。
回答by ayyp
I believe -ms
is the vendor prefix for some of the new CSS3 properties while filter
is an older property meant for IE 6-8(I could be wrong on IE 6, but I know for sure it's used in IE 8). Here's more information on where -ms
is used: http://msdn.microsoft.com/en-us/library/ms531207(VS.85).aspx.
我相信-ms
是一些新 CSS3 属性的供应商前缀filter
,而是用于 IE 6-8 的旧属性(我在 IE 6 上可能是错的,但我确定它在 IE 8 中使用)。以下是有关使用位置的更多信息-ms
:http: //msdn.microsoft.com/en-us/library/ms531207(VS.85).aspx。