开发者

opacity issue - also setting image

I have an issue with the opacity setting my image as well. Is there a way to not set the opacity of my image?

<div id="divShow" runat="server" visible="false" 
        style="opacity:0.4; filter:alpha(opacity=40); background-color:Black; width:100%; height:100%; z-index:10; top:0; left:0; position:fixed;">
   <table>

   <tr><td align="center">
       <asp:Image ID="imgShow" runat="server" ImageUrl="~/Image/Car.jpg"/>
        <asp:LinkButton ID="lnkClose" runat="server" Font-Size="8pt" 
                   Width="200px" 
           style="top: 196px; left: 60px; position: absolute; height: 16px">Close</asp:LinkButt开发者_运维百科on>
   </td></tr></table></div>


I think what you're looking for is rgba(). Set your style to the following:

#divShow {
  background: rgb(0, 0, 0); /* The Fallback */
  background: rgba(0, 0, 0, 0.4);
  -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
  filter: alpha(opacity=40);
}

keep -ms-filter before filter if you want it to work properly in all version of IE.

//EDIT

Here is your code with the new styles:

<div id="divShow" runat="server" visible="false" 
        style="height:100%; width:100%; z-index:10; position:fixed; top:0; left:0; background:black; background: rgba(0,0,0,0.4); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; filter: alpha(opacity=40);">
   <table>
       <tr>
          <td align="center">
             <asp:Image ID="imgShow" runat="server" ImageUrl="~/Image/Car.jpg"/>
             <asp:LinkButton ID="lnkClose" runat="server" Font-Size="8pt" width="200px" style="top: 196px; left: 60px; position: absolute; height: 16px">
                Close
             </asp:LinkButton>
          </td>
       </tr>
   </table>
</div>


Is there a way to not set the opacity of my image?

Ummm...if you don't won't it opaque, don't add the CSS to make it opaque?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜