I'm struggling with creating an overlay hover effect on an image that has transparency. The issue I'm facing is that the black background of the parent div element is filling in the transparent parts of the PNG image, making it look like those areas are set to opacity: 0.
Below is my HTML code:
<div class="parent">
<img src="transparent.png"/>
</div>
And here's my CSS code:
.parent {
background-color: #000000;
}
.parent img:hover {
opacity: .7;
}