I was trying to set up a div that displays information about a product when the user hovers over it, but for some reason the info div keeps glitching and is not staying stable. Here's the code:
.product {
position: absolute;
background-color: blue;
width: 100px;
height: 200px;
z-index: 1;
}
.info {
position: absolute;
background-color: red;
width: 300px;
height: 300px;
z-index: 2;
opacity: 0.5;
visibility: hidden;
}
.product:hover + .info {
visibility: visible;
}
<div class="parent">
<div class="product"></div>
<div class="info"></div>
</div>
How can I prevent the glitching and have a stable version of this feature without the info div constantly appearing and disappearing?