Home > HTML/CSS > Opacity not working in IE7

Opacity not working in IE7

I have had good results using the following CSS for setting the opacity  in most modern browsers.

filter: alpha(opacity=70);     /* Internet Explorer */
-moz-opacity:0.7;           /* Mozilla 1.6 and below */
opacity: 0.7;               /* newer Mozilla and CSS-3 */

But, I was working on a site last night that needed to use this and it was not working in IE7. I don’t know why it didn’t work, but I I had a DIV that had to stacked DIVs inside it, and the bottom DIV was the one I wanted to set the opacity for. It worked in FireFox and Safari but not IE7. There was a table inside the bottom DIV (if that makes a difference) and the container DIV was absolutly positioned.

I read a few things about how the element needed to be positioned, so I added position:relative to the CSS. That didn’t work.

I then found a post about using zoom: 1. I tried this and it worked. I don’t know what zoom does and why it worked, but it did.

Categories: HTML/CSS
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.