views:

330

answers:

3

I added the attribute opacity: .3; to my img tag but it only works for firefox. Is there a solution for firefox and ie8?

+3  A: 
<img src="yourimage.jpg" alt="Text" class="opac" />

<style>
.opac
{
    opacity:0.3; filter:alpha(opacity=30); height: 150px; width: 150px;
}
</style>
rahul
thanks stackoverflow is rescuing my day
Markus
+2  A: 

IE uses the filter property:

filter: alpha(opacity = 30); /* Supported by IE7 and 8 */

That should do the same as opacity: 0.3

peirix
+2  A: 

If you're using ie8 in standards mode you need to use:

-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
Russell Leggett
IIRC, the short version works too: -ms-filter:"Alpha(Opacity=30)";
scunliffe