I encountered a situation with the following code:
CSS:
<style>
div.testy {
border:1px solid black;
}
div.testy:hover {
background-color:red;
}
</style>
HTML:
<div class="testy" style="height:100px;
background: url('down.png') no-repeat; background-size:contain;">
aa
</div>
'down.png'
is an image with a transparent background. My goal was to change the background color while still displaying the image in front of it.
The code above seems to be almost correct, but when I hover over the div
, nothing happens as expected.
QUESTION: What could be causing the issue with hovering and changing the background color?
Check out this jsfiddle link for a demonstration of the problem: https://jsfiddle.net/sdsze2fv/