s.k.paul
s.k.paul

Reputation: 7311

Non-transparent image within a semi-transparent div

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>

I would like not to make the image transparent. Any help?

Upvotes: 0

Views: 229

Answers (1)

Guruprasad J Rao
Guruprasad J Rao

Reputation: 29693

try setting transparency for background-color instead of opacity for element as below

background-color:rgba(255,0,0,0.5); //0.5 is the transparency you are setting for color

for more info see this Article

Upvotes: 3

Related Questions