So I'm trying to use a hover effect on two elements. One of the elements has a absolute position, this element needs to have the background recolored once hovered. This seems to work, however I cannot get the back image to scale accordingly. I think it has to do with the absolute positioning of the first div. But I cannot find a way to fix this. I have been trying to fix it using pointer-event but I cannot get that to do the trick.
<style>
.master {
width: 1200px;
overflow: hidden;
position: relative;
}
img {
width: 100%;
}
img:hover {
transform: scale(1.2)
}
.hover {
position: absolute;
height: 100%;
width: 100%;
}
.hover:hover {
background: rgba(255, 0, 0, 0.5);
}
</style>
<div class="master">
<div class="hover">
</div>
<img src="http://via.placeholder.com/1200x350" alt="">
</div>
This is the code I have got right now