I tried making an image change to another while hovering, but instead, the second one appeared without the first disappearing this is the code, is there anything I did wrong. hope you find the question clear
.card {
width: 130px;
height: 195px;
position: relative;
display: inline-block;
margin: 50px;
}
.card .img-top {
display: none;
position: absolute;
top: 0;
left: 0;
z-index: 99;
}
.card:hover .img-top {
display: inline;
}
.card {
width: 130px;
height: 195px;
position: relative;
display: inline-block;
margin: 50px;
}
.card .img-top {
display: none;
position: absolute;
top: 0;
left: 0;
z-index: 99;
}
.card:hover .img-top {
display: inline;
}
<div class="card">
<img src="redlo.jpg" width="100" height="100" alt="first">
<img src="whitelo.jpg" class="img-top" width="100" height="100" alt="second">
</div>