I tried to use Internet Explorer's "glow" visual filter on a webpage, but it had no effect when I viewed the page in Internet Explorer 9. I checked the MSDN website and it says Visual Filt开发者_开发知识库ers and Transitions are deprecated in IE9. So what is the IE9 equivalent of CSS code like the following?:
filter: progid:DXImageTransform.Microsoft.glow(color=black, strength=5);
Is there any way at all to achieve decent-looking, readable white-on-white in IE9?
Many of the things filters were used for have been replaced with CSS3. The effect you're looking for (glow) requires the CSS3 text-shadow
property which, unfortunately, is not available in IE9.
For now you can use -ms-filter
such as -ms-filter: "glow(color=red, strength=5)"
Small demo: http://jsfiddle.net/frozenkoi/nsr4F/
Note that according to Introduction to Filters and Transitions , the prefered syntax is to include the PROGID of the filter and using quotes, like -ms-filter:"progid:DXImageTransform.Microsoft.Glow(color=red, strength=5)"
since some filters will work different depending on the syntax.
More info: -ms-filter Attribute | filter Property & Visual Filters and Transitions Reference
Try to use filter:shadow(color=#dddddd,direction=135,strength=2);
http://msdn.microsoft.com/en-us/library/ms533086(v=vs.85).aspx
filter: progid:DXImageTransform.Microsoft.glow(color=black, strength=5);
works in IE9, there is no problem
Before people are always complaining they should read references.
You have to set this meta Tag to force IE running in IE 9 mode.
<meta http-equiv="X-UA-Compatible" content="IE=9" />
you can check the running Mode with document.documentMode
if you do not set this meta tag. IE is running in Quirksmode to support backwards compatibility and then filters only work if you set the Doctype to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
as it was earlier, if you can remember.
精彩评论