I want to have a hover animation that disappears when hovering over the picture and another picture takes its place, but the back picture isn't disappearing
I tried to use opacity 1 to go to 0, and transition time 0.5sec but it's stuck in the old position
.Menu .mnpic {
transform: translateX(30%);
/* display: flex;
justify-content: center;
align-content: center; */
}
.mnovly {
position: absolute;
top: 0;
}
.mwhite{
/* position: relative; */
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>