问题
I added the attribute opacity: .3;
to my img
tag but it only works for firefox. Is there a solution for firefox and ie8?
回答1:
<img src="yourimage.jpg" alt="Text" class="opac" />
<style>
.opac
{
opacity:0.3; filter:alpha(opacity=30); height: 150px; width: 150px;
}
</style>
回答2:
If you're using ie8 in standards mode you need to use:
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
回答3:
IE uses the filter
property:
filter: alpha(opacity = 30); /* Supported by IE7 and 8 */
That should do the same as opacity: 0.3
来源:https://stackoverflow.com/questions/1426846/i-need-opacity-transparency-for-a-img-with-css-ie8