Opacity Properity in IE6

2020-03-31 09:38发布

问题:

I have been working on this for a little while, and I have also searched stackoverflow, but couldn't find an answer.

Here's what I'm trying to do:

#container {
    margin: 0 auto;
    width: 950px;
    opacity: .5;
    filter: alpha(opacity = 50);
    background: #fff;
    filter: alpha(opacity=50);
    -moz-opacity: 0.5;
    -khtml-opacity: 0.5;
    opacity: 0.5;
}

But it doesn't work for me in using IETester.
The other versions display it correctly, IE6 does not.

So, where is the bug?
What have I missed ?

回答1:

For IE 6 and 7, try the following:

filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);

Source.