I am working on creating an interesting hover effect where the background changes dynamically. I want to have a div with an image as the background, overlay (another div) with 50% opacity in any color, and then upon hovering, make the background white. I tried adjusting the opacity of the overlay but it didn't produce the desired effect.
I have searched everywhere for a solution but couldn't find anything that worked. Can someone please provide me with some guidance or insights into how to achieve this effect?
The gif below illustrates the effect I am aiming for. Thank you in advance for your assistance!
https://i.sstatic.net/BVuD9.gif
UPDATE: I have included the code snippet below.
.qm-container {
display: flex;
flex-direction: column;
width: 33%;
min-height: 35%;
position: relative;
margin: 0 50px;
}
.qm-container img {
position: absolute;
width: 100%;
height: 100%;
}
.qm-overlay {
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
background: rgb(5, 69, 151);
z-index: 1;
opacity: 0.65;
}
.qm-container h6 {
z-index: 2;
color: white;
}
.qm-container p {
z-index: 2;
color: white;
}
.qm-container:hover {
color: white;
transition: all .6s;
}
<div class="qm-container">
<img src="/img/Qmupdated.png" alt="">
<div class="qm-overlay"></div>
<div class="quality-management">
<h6>1. Quality Management Systems according to ISO 9000 2015</h6>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. In omnis magni praesentium velit sit
sapiente sed magnam accusamus quisquam, maxime rem! Adipisci, quisquam? Dolor fugiat dolores
porro
quo perferendis accusamus!</p>
</div>
</div>
Here's the issue I am currently facing:
https://i.sstatic.net/AC8bi.gif
I am struggling to hide the image upon hovering over the content.