4

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?

sscirrus
  • 55,407
  • 41
  • 135
  • 228
  • Why are people still using this property? You know it only works in IE right? Plus CSS3 added its own way of creating gradient backgrounds... – animuson Mar 10 '11 at 05:19
  • 3
    @animuson: Because IE doesn't support CSS3 gradients...? – BoltClock Mar 10 '11 at 05:27
  • What's your point? I have never been a supporter of these silly properties that don't exist. Nor have I ever been a supporter of gradient backgrounds behind text. – animuson Mar 10 '11 at 05:30
  • 1
    @animuson I believe the reason is implied in the question - we'd have many happier developers in the world if IE just responded to box-shadow: #AAA 0px 1px 2px 0px; :) – sscirrus Mar 10 '11 at 05:32
  • @animuson: My point is that not everybody thinks/works the way you do, unfortunately. – BoltClock Mar 10 '11 at 05:55
  • @animuson and @BoltClock: Many of the users for my site will be using IE 7 and IE 8. It would be great (and easier) to just wait for everyone to catch up but for my audience, either my boxes will look designed or they won't. – sscirrus Mar 10 '11 at 07:44

1 Answers1

1

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.

animuson
  • 53,861
  • 28
  • 137
  • 147
  • 2
    Just to clarify, is there is NO version of IE at all that only responds to -ms-filter and not the regular filter? – sscirrus Mar 10 '11 at 07:42
  • The versions before 5.5 may only respond to the prefixed property, if it existed before then. According to documentation, though, both should work for all versions 5.5 and on. The only real way to know is to test it in those older versions, if you really think testing in IE5.5 is that important to you. Personally, I'd trust the documentation. – animuson Mar 10 '11 at 07:47
  • Thanks for your answer animuson. Out of curiosity, could you please explain why you don't like using the filter property? Do you use a different method to style for IE or do you not worry about IE styling? – sscirrus Mar 10 '11 at 07:52
  • I do not worry about the stylings in IE, or any other browser which does not support a property for that matter. Personally, I believe that prefixed properties and browser-specific properties are solely for beta testing and should not be used in actual live designs. Also, as I stated above, I dislike gradient backgrounds behind text. – animuson Mar 10 '11 at 07:57
  • @animuson, the prefixed was introduced in IE 8. http://blogs.msdn.com/b/ie/archive/2008/09/08/microsoft-css-vendor-extensions.aspx – Matthew Flaschen Dec 06 '12 at 19:17