CSS
.popup {
z-index: 10000;
filter: alpha(opacity=40);
-moz-opacity: .40;
background-color: #000000;
}
HTML
<div class="popup" style="display: none; overflow: auto;">
<img src="~/image.png" /> <!--it also becomes transparent. -->
</div>
我不想让图片透明。有什么帮助吗?
答案 0 :(得分:2)
尝试为background-color
而不是opacity
设置透明度,如下所示
background-color:rgba(255,0,0,0.5); //0.5 is the transparency you are setting for color
了解更多信息,请参阅 Article