I'm looking to create a hover animation where one picture disappears upon hovering and is replaced by another picture, but I'm having trouble getting the back picture to disappear
My attempt involved changing opacity from 1 to 0 with a transition time of 0.5 seconds, but the image remains stuck in its original position
.Menu .mnpic {
transform: translateX(30%);
}
.mnovly {
position: absolute;
top: 0;
}
.mwhite{
opacity: 1;
transition: 0.5s;
}
.mwhite:hover {
opacity: 0;
}
.mblack{
opacity: 0;
transition: 0.5s;
}
.mblack:hover{
opacity: 1;
height: 200px;
}
<div class="mnpic">
<img calss="mwhite" src="menuwhite.png" alt="" height="150px">
<div class="mnovly">
<img class="mblack" src="menublack.png" alt="" height="150px">
</div>
</div>