CSS 与 IE - 是否需要 -ms-filter?
我一直在了解 IE 对阴影、渐变等看起来相当荒谬的要求,在这一点上我遇到了一些矛盾:
许多网站建议以下几行对于渐变/阴影组合是必要的:
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#F8F8F8') progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=170, Color='#C6C6C6');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#F8F8F8') progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=170, Color='#C6C6C6')"; }
CSS3Please.com 建议只有第一个过滤器是完全符合 IE 5.5-9 所必需的,即 -ms-filter 根本没有用处。是否还需要 -ms-filter 还是 IE 开发中的临时情况?
I have been learning about IE's rather ridiculous-looking requirements for shadows, gradients, etc., and I'm running into some contradictions on this point:
Many sites suggest the following lines are necessary for a gradient/shadow combination:
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#F8F8F8') progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=170, Color='#C6C6C6');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#F8F8F8') progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=170, Color='#C6C6C6')"; }
CSS3Please.com suggests only the first filter is necessary for full compliance with IE 5.5-9, i.e. that the -ms-filter is of no use at all. Is -ms-filter needed any more or was that a temporary case in IE's development?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答你的问题,即使我不同意它的使用,不,这不是必需的。 “-ms-”前缀和其他前缀(例如“-moz-”和“-webkit-”)是特定于浏览器的,通常仅在浏览器开发新属性时使用。他们在浏览器的更高版本中保留了前缀属性,以便使用前缀属性的网页仍然可以工作,但两种方法都做完全相同的事情。
PS IE 9确实支持CSS3。它随 Windows 7 SP1 一起发布。
To answer your question even though I don't agree with its use, no it is not required. The "-ms-" prefix and other prefixes (such as "-moz-" and "-webkit-") are browser-specific and are usually just used while browsers are developing new properties. They leave the prefixed properties in later versions of the browser so that webpages using the prefixed property will still work, but both ways do the exact same thing.
P.S. IE 9 does support CSS3. It was released with Windows 7 SP1.