IE5.5 - 8 opacity test

Note that IE6 and IE7 need haslayout applied to the element for opacity to work

IE8 RC1 doesn't apply opacity to elements with display:inline

opacity1 ... filter:"Alpha(Opacity=40)" (with quotes)

Works in IE5.5 only

opacity2 ... filter:Alpha(Opacity=40) (no quotes)

Works in IE5.5, IE6, IE7 and IE8 RC1

opacity3 ... filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)" (with quotes)

Works in IE5.5 only

opacity4 ... filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40) (no quotes)

Works in IE5.5, IE6, IE7 and IE8 RC1

opacity5 ... -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)" (with quotes)

Works in IE8 RC1 only

opacity6 ... -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40) (no quotes)

Works in none

opacity7 ... -ms-filter: "Alpha(Opacity=40)" (with quotes)

Works in IE8 RC1 only

opacity8 ... -ms-filter: Alpha(Opacity=40) (no quotes)

Works in none

display-inline ... filter:Alpha(Opacity=40);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";

Doesn't work in IE8 but will work in ie5.5 - 7 (because element haslayout via zoom property)

Ie8 RC1's behaviour has changed since IE8 beta2 when it would have worked with all 4 of the below.

#opacity1 {
background:red;
filter:"Alpha(opacity=60)";
margin:10px;
}
#opacity2 {
background:red;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
margin:10px;
}
#opacity3 {
background:red;
-ms-filter: "Alpha(Opacity=40)";
margin:10px;
}
#opacity4 {
background:red;
filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
margin:10px;
}

I think we should assume that the only safe styles for future versions of IE8 would be to use the following combinations.

filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40)
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"

Or:
filter:Alpha(Opacity=40);
-ms-filter: "Alpha(Opacity=40)";