CSS Hack: Opacity on IE

If you want to get opacity to work on all IE browsers, use the following IE filters in the order:
.opaque {
  -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; // for IE8/9
  filter: alpha(opacity=50);  // for IE5-7
  opacity: .5;  // for all other browsers    
}

Note: opacity gets inherited by child elements. So it's better to use background-color:rgba(r,g,b,alpha). For IE browsers, use gradient filter with #argb.

Comments

  1. It's a good hack for IE in general, however, it may not be required for IE5 and IE 5.5 anymore.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to resolve 'res://ieframe.dll/acr_error.htm#' error (Internet Explorer stopped working while viewing a website)

htaccess: Redirecting multiple domains to the main domain

MailChimp API V2.0 SSL error solution