Wednesday, April 16, 2014

The property 'opacity' is not compatible with Internet Explorer 8.0

Introduction

I had to set opacity value for a text using cascading style (CSS). But when I type opacity it showed “The property 'opacity' is not compatible with Internet Explorer 8.0” in Visual Studio. See the screen shot below. 



Solution

To set the opacity value you have to set both opacity and a filter value; so that it will work for all browsers. 

   
p {
    opacity: 0.8;//0.0 is fully transparent and 1.0 is fully opaque 
    filter: alpha(opacity=80);//Here 0 is transparent and 100 is fully opaque 
}
 

Conclusion

Reference: 
Programming with HTML5 with JavaScript and CSS3 – A Microsoft Learning Product

No comments:

Post a Comment