Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>My suggestion:</p> <p>Use CSS3Pie -- <a href="http://css3pie.com/" rel="nofollow">http://css3pie.com/</a></p> <p>This is a JavaScript library for IE6, IE7 and IE8 that patches in support for several CSS3 features, including gradients.</p> <p>Yes, you can use the horrible IE-specific <code>filter</code> styles if you want, but CSS3Pie allows you to use standard CSS styles for these features. Much easier.</p> <p><strong>To actually answer your direct question:</strong></p> <p>Yes, the <code>-ms-filter</code> style is usually required. IE8 will always us it instead of <code>filter</code>, which is used primarily for IE6 and IE7. In some cases <code>filter</code> will work in IE8, but not all, so it's best to use <code>-ms-filter</code> to ensure IE8 compatibility.</p> <p>[EDITED] Why did they change it? Because when they released IE8, Microsoft made a big point of trying to be "standards compliant".</p> <p>For a browser to be standard-compliant, it should use a vendor prefix for any CSS property it supports that is not a finalized W3C standard. So by adding the <code>-ms-</code> prefix, Microsoft were trying to (belatedly) undo their pollution of the global CSS namespace.</p> <p>In addition, the quotes were added, because the old <code>filter</code> syntax without the quotes was invalid CSS (mainly because of the colon after <code>progid</code>), and caused issues with some browsers. (I had an instance some time ago with Firefox 3.6 where it was dropping all styles following a <code>filter</code> style that rotated an element - took ages to work out what was happening).</p> <p>The fact that Microsoft retained backward compatibility with the original <code>filter</code> syntax, was largely a matter of pragmatism. MS couldn't afford to break all the sites using the old syntax. But there was a strong implication from Microsoft that developers should use both because they would drop support for the old <code>filter</code> style in subsequent versions of IE. As it turned out, they dropped support for both <code>filter</code> and <code>-ms-filer</code> in one fell swoop, but the implications given at the release of IE8 were sufficient for it to become recommended practice to provide both syntaxes in your stylesheet.</p> <p>At the time when IE8 was released, XHTML was the new flavor of the month, and writing code that validated perfectly was top of the list for a lot of developers. This was probably a strong driving force in the change of syntax to include the quotes. Because of the stray colons, it is impossible to write CSS that validates using the old <code>filter</code> style. Using the new <code>-ms-filter</code> styles instead allowed people to write valid CSS. As good ideas go, this one didn't really work out because of course people had to keep using the old syntax anyway, but the intent was good.</p> <p>It's worth pointing out that other proprietary styles were given the same treatment. For example, you can use <code>-ms-behavior</code> in IE8 instead of the old <code>behavior</code> style. No-one uses it. Why? I don't really know.</p> <p>Another fact worth knowing is that the W3C are in the process of standardizing a <a href="https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html" rel="nofollow">CSS property called <code>filter</code></a>. It will do a completely different job to the Microsoft <code>filter</code> style, and work completely differently. If/when it is standardized and browsers start supporting it, there will be an explicit clash between the two syntaxes.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload