3

I don't understand the difference between behavior and -ms-behavior. I thought behavior was already only for Microsoft's Internet Explorer, so why is there a vendor prefix version?

Does it make any sense to use both or just -ms-behavior?

Oka
  • 23,367
  • 6
  • 42
  • 53

2 Answers2

2

Internet Explorer versions 5 and above support the behavior property.

Internet Explorer Version 8 supports the syntactically correct Vendor Specific Extension format of-ms-behavior.

The majority of the time you only need behavior, unless you want to totally force IE8 versions to run in standard mode. Then you should use ms-behavior. But adding both doesn't hurt you at all and it probably is a good practice anyways.

Henry Zhu
  • 2,488
  • 9
  • 43
  • 87
  • So the main thing about css properities with a vendor prefix is that e.g. "behavior" is read by every browser even if they ignore it later. but e.g. "-ms-behavior" isnt even read by other browsers than IE. am I right about this? – blacksunshineCoding Jul 08 '15 at 19:43
1

Windows Internet Explorer 8. The -ms-behavior attribute is an extension to CSS, and can be used as a synonym for behavior in IE8 Standards mode.

Check https://msdn.microsoft.com/en-us/library/ms530723(v=vs.85).aspx for more information

captainsac
  • 2,484
  • 3
  • 27
  • 48